|
|
|
@ -1,7 +1,8 @@
|
|
|
|
|
/** @import { Effect, Source } from '#client' */
|
|
|
|
|
import { noop } from '../../shared/utils.js';
|
|
|
|
|
import { flushSync } from '../runtime.js';
|
|
|
|
|
import { internal_set, source } from './sources.js';
|
|
|
|
|
import { raf } from '../timing.js';
|
|
|
|
|
import { internal_set, pending } from './sources.js';
|
|
|
|
|
|
|
|
|
|
/** @type {Set<Fork>} */
|
|
|
|
|
const forks = new Set();
|
|
|
|
@ -13,8 +14,6 @@ export function remove_active_fork() {
|
|
|
|
|
active_fork = null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export let pending = source(false);
|
|
|
|
|
|
|
|
|
|
function update_pending() {
|
|
|
|
|
internal_set(pending, forks.size > 0);
|
|
|
|
|
}
|
|
|
|
@ -144,7 +143,7 @@ export class Fork {
|
|
|
|
|
static ensure() {
|
|
|
|
|
if (active_fork === null) {
|
|
|
|
|
if (forks.size === 0) {
|
|
|
|
|
requestAnimationFrame(update_pending);
|
|
|
|
|
raf.tick(update_pending);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
active_fork = new Fork();
|
|
|
|
|