Storex.Store behaviour (storex v0.1.1) View Source

Link to this section Summary

Link to this section Callbacks

Link to this callback

init(session_id, params)

View Source

Specs

init(session_id :: binary(), params :: any()) :: any()

Called when store session starts.

Link to this callback

mutation(name, data, session_id, params, state)

View Source

Specs

mutation(
  name :: binary(),
  data :: any(),
  session_id :: binary(),
  params :: any(),
  state :: any()
) ::
  {:reply, message :: any(), state :: any()}
  | {:noreply, state :: any()}
  | {:error, state :: any()}
Link to this callback

terminate(session_id, params, state)

View Source (optional)

Specs

terminate(session_id :: binary(), params :: any(), state :: any()) :: any()

Called when store session ends.