mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-10-11 09:22:21 +02:00
Squash Odysseus development history
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
/** Cooperative render generations shared by synchronous and future async renderers. */
|
||||
export function createRenderGeneration() {
|
||||
let generation = 0;
|
||||
return {
|
||||
begin() {
|
||||
const id = ++generation;
|
||||
return {
|
||||
id,
|
||||
isCurrent: () => id === generation,
|
||||
cancel: () => { if (id === generation) generation += 1; },
|
||||
};
|
||||
},
|
||||
invalidate() { generation += 1; },
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user