1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
use crate::*;
/// Scheduling flag to batch signal updates within a single tick.
///
/// Set to `true` when `schedule_update()` queues a microtask,
/// and reset to `false` when the dispatch callback fires.
pub static SCHEDULED: AtomicBool = new;
/// Suppress flag to prevent `schedule_update()` from dispatching
/// during internal operations such as `batch`.
pub static SUPPRESS_SCHEDULE: AtomicBool = new;
/// The currently active `HookContext`.
///
/// SAFETY: Must only be accessed from the main thread (WASM single-threaded context).
pub static mut CURRENT_HOOK_CONTEXT: CurrentHookContextCell =
CurrentHookContextCell;
/// The dynamic node ID currently being rendered/set up.
///
/// When a DynamicNode is being initialized or re-rendered, this is set to
/// the dynamic_id so that any signal `get()` calls during that render
/// can register the dependency. `usize::MAX` means "no tracking active".
///
/// SAFETY: Must only be accessed from the main thread (WASM single-threaded context).
pub static CURRENT_TRACKING_DYNAMIC_ID: AtomicUsize = new;
thread_local!