Interface State<T>
- Type Parameters:
T- the value type
- All Superinterfaces:
StateToken
- All Known Subinterfaces:
MutableState<T>
- All Known Implementing Classes:
InitialStateImpl,LazyStateImpl,MutableStateImpl
Read access to a per-context value identified by this token. Values live in the
context's session and are dropped when the context closes.
-
Method Summary
Modifier and TypeMethodDescriptionget(@NotNull ViewContext context) Reads this token's value for the given context.
-
Method Details
-
get
Reads this token's value for the given context. Callable from any thread, but values are only coherent on the main thread.- Parameters:
context- an active context of the owning view- Returns:
- the current value, possibly
null - Throws:
StaleContextException- when the context belongs to another view or is closed
-