Module
Redox.Store
- Package
- purescript-redox
- Repository
- coot/purescript-redox
#CreateRedox Source
data CreateRedox :: Effect
Effect for creating Redox Store
#WriteRedox Source
data WriteRedox :: Effect
Effect for writing to the store
#SubscribeRedox Source
data SubscribeRedox :: Effect
Effect for (un)subscribing to the store
#ReadOnlyRedox Source
type ReadOnlyRedox eff = (readRedox :: ReadRedox | eff)
#WriteOnlyRedox Source
type WriteOnlyRedox eff = (writeRedox :: WriteRedox | eff)
#ReadWriteRedox Source
type ReadWriteRedox eff = (readRedox :: ReadRedox, writeRedox :: WriteRedox | eff)
#ReadWriteSubscribeRedox Source
type ReadWriteSubscribeRedox eff = (readRedox :: ReadRedox, subscribeRedox :: SubscribeRedox, writeRedox :: WriteRedox | eff)
#mkStore Source
mkStore :: forall eff state. state -> Eff (createRedox :: CreateRedox | eff) (Store state)
Make store with initial state. Store is a mutable container with a subscription mechanism.
#SubscriptionId Source
#subscribe Source
subscribe :: forall eff state. Store state -> (state -> Eff (subscribeRedox :: SubscribeRedox | eff) Unit) -> Eff (subscribeRedox :: SubscribeRedox | eff) SubscriptionId
Subscribe to store updates. Note that store updates are not run by the store itself. That is left to dispatch or the DSL interpreter. It returns id of the subscribed callback. You can use it to remove the subscription.
#unsubscribe Source
unsubscribe :: forall eff state. Store state -> SubscriptionId -> Eff (subscribeRedox :: SubscribeRedox | eff) Unit
Remove a subscription with a given id.
#mapStore Source
mapStore :: forall eff state' state. (state -> state') -> Store state -> Eff (ReadWriteRedox eff) (Store state')
#setState Source
setState :: forall eff state. Store state -> state -> Eff (WriteOnlyRedox eff) (Store state)
#performCreateRedoxEff Source
performCreateRedoxEff :: forall a. Eff (createRedox :: CreateRedox) a -> a
#performWriteRedoxEff Source
performWriteRedoxEff :: forall a. Eff (WriteOnlyRedox ()) a -> a
#performReadRedoxEff Source
performReadRedoxEff :: forall a. Eff (ReadOnlyRedox ()) a -> a
#performReadWriteRedoxEff Source
performReadWriteRedoxEff :: forall a. Eff (ReadWriteRedox ()) a -> a
- Modules
- Redox
- Redox.
DSL - Redox.
Store - Redox.
Utils