types library
An export of the lower level types that make up the implementation details
of rxs. The user should normally use the exports here merely as types and
instead prefer to use hooks to define the logic in their application.
Classes
-
ReadOnlyState<
Value> - State with read only access.
-
State<
Value> - State is data that (1) exists throughout the lifetime of the application and (2) is subject to changes over time. Additionally any given state within this library must cause other states using it to react accordingly to any changes to it, and may cascade down a graph or chain of states.
-
StateContext<
Value> -
The context for the current status of the Stateful
Value. -
StateReference<
Child extends State> - A nullable reference to a State object.
-
StrongStateReference<
T, Child extends State< T> > - A reference to a State object.
- SubscriptionContext
- Provides States with SubscriptionContext.
-
WeakStateReference<
T, Child extends State< T> > - A weak reference to a State object.
-
WritableState<
Value> - State with read and write access.
Properties
- defaultContext → SubscriptionContext
-
Default SubscriptionContext.
final
Typedefs
-
Composite<
Value> = Value Function() - A composition of multiple child states.
- OnAccess = void Function(StateNotification? notification)?
- Lifecycle hook when state is read.
-
OnNotify<
Value> = void Function(StateNotification notification, Value state, {required bool lazy})? - Lifecycle hook when state is notified.
-
StateGetter<
Value> = Value Function() -
Callback function that returns a
Value. -
StateMutator<
Value> = void Function(Value value) -
Callback function that mutates the given
value. -
StateUpdater<
Value> = Value Function(Value value) -
Callback function that accepts the given
valueand returns a newValue.