xr library

Classes

AsyncReactor<T>
AsyncState<T>
Event<T>
Optional<T>
Reactor<T>
ReactorBuilder
VoidEvent
Special Case of Event where there is no value. Like say button clicked.

Properties

changedNodes Set<Reactor>
getter/setter pair
microtaskScheduled bool
getter/setter pair
xrDAG DAG
final

Functions

addReactor(DAG dag, Reactor reactor, Set dependsOn) → void
dfs(DAG dag, dynamic node, Set visited, List sortedNodes) → void
disposeReactor(DAG dag, Reactor reactor) → void
markNodeChanged(DAG dag, dynamic node, Set<Reactor> changedNodes) → void
topologicalSort(DAG dag) List
Topological sort algorithm adopted from wikipedia - https://en.wikipedia.org/wiki/Topological_sorting#Depth-first_search
updateNodes() → void

Typedefs

AsyncReactionGenerator<T> = FutureOr<T> Function(AsyncReactor<T>)
DAG = Map<dynamic, Set<Reactor>>
Directed Acyclic Graph in the form of Adjacency List. We really don't care about the type of the key. What matters we want to associate an object with the reactors to call when the object changes.
ReactionGenerator<T> = T Function(Reactor<T>)
ReactorBuilderCallback = Widget Function(BuildContext)