StateLoader
korolev.server.StateLoader$
object StateLoader
Attributes
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
- Self type
- StateLoader.type
Members list
Concise view
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.
Attributes
- S
Type of state
- initialState
State factory
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, ...)
}
}