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
43
//! Observer infrastructure for automatic dependency tracking.
//!
//! Used by [`Memo`](crate::Memo) during computation. When an
//! [`ObserverState`] is installed in the thread-local [`OBSERVER`] slot,
//! every [`Signal::read`](crate::Signal::read) / [`Signal::with`](crate::Signal::with)
//! call auto-subscribes the observer to that signal.
use RefCell;
use HashSet;
use Rc;
use crateSignalKey;
/// Installed by [`Memo`](crate::Memo) during computation.
///
/// When set, every [`Signal::read`](crate::Signal::read) /
/// [`Signal::with`](crate::Signal::with) call subscribes the observer's
/// dirty callback to that signal and hands a cleanup closure back via
/// `on_subscribe`.
pub
thread_local!