Module

Redox.Free

Package
purescript-redox
Repository
coot/purescript-redox

#_dispatch Source

_dispatch :: forall dsl state. (Either Error state -> Effect Unit) -> Interpret dsl state -> Store state -> Free dsl (state -> state) -> Effect (Fiber Unit)

#dispatch Source

dispatch :: forall dsl state. (Error -> Effect Unit) -> Interpret dsl state -> Store state -> Free dsl (state -> state) -> Effect (Fiber Unit)

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. This is useful if you want to have a batch dispatch that dispatches all the commands at once when the interpreter finished running your DSL.

#dispatchP Source

dispatchP :: forall dsl state. (Error -> Effect Unit) -> Interpret dsl state -> Store state -> Free dsl (state -> state) -> Effect (Fiber Unit)

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