Liking cljdoc? Tell your friends :D

state-flow.state


ensure-stepclj

(ensure-step value)

Internal use only.

Given a state-flow step, returns value as/is, else wraps value in a state-flow step.

Internal use only.

Given a state-flow step, returns value as/is, else wraps value in a state-flow step.
sourceraw docstring

error-catching-stateclj

(error-catching-state mfn)
source

evalclj

source

execclj

source

fmapclj

(fmap f flow)

Creates a flow that returns the application of f to the return of flow

Creates a flow that returns the application of f to the return of flow
sourceraw docstring

getclj

(get)

Creates a flow that returns the value of state.

Creates a flow that returns the value of state. 
sourceraw docstring

getsclj

(gets)
(gets f & args)

Creates a flow that returns the result of applying f (default identity) to state with any additional args.

Creates a flow that returns the result of applying f (default identity)
to state with any additional args.
sourceraw docstring

invokeclj

(invoke my-fn)

Creates a flow that invokes a function of no arguments and returns the result. Used to invoke side effects e.g.

(state-flow.core/invoke #(Thread/sleep 1000))

Creates a flow that invokes a function of no arguments and returns the
result. Used to invoke side effects e.g.

   (state-flow.core/invoke #(Thread/sleep 1000))
sourceraw docstring

modifyclj

(modify f & args)

Creates a flow that replaces state with the result of applying f to state with any additional args.

Creates a flow that replaces state with the result of applying f to
state with any additional args.
sourceraw docstring

putclj

(put new-state)

Creates a flow that replaces state with new-state.

Creates a flow that replaces state with new-state. 
sourceraw docstring

returnclj

(return v)

Creates a flow that returns v. Use this as the last step in a flow that you want to reuse in other flows, in order to clarify the return value, e.g.

(def increment-count (flow "increments :count and returns it" (state/modify update :count inc) [new-count (state/gets :count)] (state-flow/return new-count)))

Creates a flow that returns v. Use this as the last
step in a flow that you want to reuse in other flows, in
order to clarify the return value, e.g.

  (def increment-count
    (flow "increments :count and returns it"
      (state/modify update :count inc)
      [new-count (state/gets :count)]
      (state-flow/return new-count)))
sourceraw docstring

runclj

source

short-circuiting-contextclj

Same as state monad context, but short circuits if error happens, place error in return value

Same as state monad context, but short circuits if error happens, place error in return value
sourceraw docstring

state?clj

source

swapcljdeprecated

(swap f)

DEPRECATED: use state-flow.state/modify instead.

DEPRECATED: use state-flow.state/modify instead.
sourceraw docstring

whenclj

(when e flow)

Given an expression e and a flow, if the expression is logical true, return the flow. Otherwise, return nil in a monadic context.

Given an expression `e` and a flow, if the expression is logical true, return the flow. Otherwise, return nil in a monadic context.
sourceraw docstring

wrap-fncljdeprecated

DEPRECATED: Use state-flow.state/invoke instead.

DEPRECATED: Use state-flow.state/invoke instead.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close