LiveEx.Example (live_ex v0.3.0) View Source
Example Implementation of a LiveEx Store that is used by Phoenix.LiveView
s.
Link to this section Summary
Functions
Commit a change to the store.
Dispatch an Action with a type
and an optional payload.
Handles a dispatch and commits a mutation based on the payload of the action.
Call this function from the mount/2
function of your "root"-LiveView.
Configures the socket with an initial setup.
Mutates the :no_payload
variable of the store.
Link to this section Types
Specs
socket() :: Phoenix.LiveView.Socket.t()
Link to this section Functions
Specs
Commit a change to the store.
Specs
Dispatch an Action with a type
and an optional payload.
Specs
Handles a dispatch and commits a mutation based on the payload of the action.
action
here has the format: %{type: :a_type_here, payload: %{}}
Specs
Call this function from the mount/2
function of your "root"-LiveView.
Adds the initial state variables to the socket.assigns
and returns the updated LiveView.Socket
.
Specs
Configures the socket with an initial setup.
The pid
of the parent process is stored in the socket.assigns
so that
Child processes can dispatch Actions on the parents's Store.
Specs
Mutates the :no_payload
variable of the store.