saealib.core.StateView#
- class saealib.core.StateView(store, reads, *, context=None, dispatch=None)[source]#
Bases:
objectRead-only projection of a store for declared state keys.
- Parameters:
store (StateStore)
reads (Iterable[StateKey] | StateContract)
context (object | None)
dispatch (Callable[[object], None] | None)
Methods
Return presence for a declared key. |
|
Dispatch a component event through the bound runtime callback. |
|
Return a declared value, making arrays read-only for the caller. |
Method Details
- StateView.__init__(store, reads, *, context=None, dispatch=None)[source]#
- Parameters:
store (StateStore)
reads (Iterable[StateKey] | StateContract)
context (object | None)
dispatch (Callable[[object], None] | None)
- Return type:
None
- StateView.contains(key)[source]#
Return presence for a declared key.
- Parameters:
key (StateKey)
- Return type:
bool