StateLoader
korolev.server.StateLoader$
object StateLoader
Attributes
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
StateLoader.type
Members list
Value members
Concrete methods
State depends on deviceId and HTTP-request. Second one could be None if case when user reconnected to restarted application and state wasn't restored.
State depends on deviceId and HTTP-request. Second one could be None if case when user reconnected to restarted application and state wasn't restored.
Attributes
State is same for all sessions.
State is same for all sessions.
Type parameters
- S
-
Type of state
Value parameters
- initialState
-
State factory
Attributes
State depends on deviceId. Useful when you want to restore user authorization.
State depends on deviceId. Useful when you want to restore user authorization.
case class MyState(deviceId: DeviceId, ...)
StateLoader.forDeviceId { deviceId =>
MyStorage.getStateByDeviceId(deviceId) map {
case Some(state) => state
case None => MyState(deviceId, ...)
}
}
Attributes
In this article