Module

Redox.DSL

Package
purescript-redox
Repository
coot/purescript-redox

#_dispatch Source

_dispatch :: forall eff dsl state. (Error -> Eff (ReadWriteSubscribeRedox eff) Unit) -> (state -> Eff (ReadWriteSubscribeRedox eff) Unit) -> (dsl -> state -> Aff (ReadWriteSubscribeRedox eff) state) -> Store state -> dsl -> Eff (ReadWriteSubscribeRedox eff) (Canceler (ReadWriteSubscribeRedox eff))

#dispatch Source

dispatch :: forall eff dsl state. (Error -> Eff (ReadWriteSubscribeRedox eff) Unit) -> (dsl -> state -> Aff (ReadWriteRedox eff) state) -> Store state -> dsl -> Eff (ReadWriteSubscribeRedox eff) (Canceler (ReadWriteSubscribeRedox eff))

Dispatch dsl commands that will be interpreted in Aff monad. You have to write your own DSL for the state changes and an interpreter for it. Check out purescript-dsl-example or see the tests.

#dispatchP Source

dispatchP :: forall eff dsl state. (Error -> Eff (ReadWriteSubscribeRedox eff) Unit) -> (dsl -> state -> Aff eff state) -> Store state -> dsl -> Eff (ReadWriteSubscribeRedox eff) (Canceler (ReadWriteSubscribeRedox eff))

Dispatch function which does not handle store updates. That's useful if the interpreter is updating the store. You can use Redox.Utils.mkIncInterp to create such interpreter.