phoenix_reducer_channel v0.1.0 RC.Store behaviour View Source

Link to this section Summary

Functions

Sets up the module to act as a store.

Callbacks

Dispatch an action to the store.

Retrieve a value from the store. Accepts the same query syntax as Kernel.get_in/2.

Retrieve the entire state.

Link to this section Types

Link to this section Functions

Sets up the module to act as a store.

Link to this section Callbacks

Link to this callback

dispatch(store, action)

View Source
dispatch(store :: Agent.agent(), action :: action()) ::
  {:ok, RC.DiffState.diff()}
  | {{:ok, term()}, RC.DiffState.diff()}
  | {:error, term()}

Dispatch an action to the store.

Link to this callback

get(store, keys)

View Source
get(store :: Agent.agent(), keys :: [term(), ...]) :: term()

Retrieve a value from the store. Accepts the same query syntax as Kernel.get_in/2.

Link to this callback

get_state(store)

View Source
get_state(store :: Agent.agent()) :: term()

Retrieve the entire state.