restore(event, defaultState)
#
Creates a Store from Event.
It works like a shortcut for createStore(defaultState).on(event, (_, payload) => payload)
Arguments
event
EventdefaultState
(Payload)
Returns
Store: New store
#
Examplerestore(effect, defaultState)
#
Creates a Store out of successful results of Effect.
It works like a shortcut for createStore(defaultState).on(effect.done, (_, {result}) => result)
Arguments
effect
EffectdefaultState
(Done)
Returns
Store: New store
#
Examplerestore(obj)
#
Creates an object with stores from object with values
Arguments
obj
(State)
Returns
Store: New store