Dala.Ui.Socket (dala v0.0.14)

Copy Markdown View Source

Backward-compatible delegate to Dala.Socket.

This module is kept for compatibility. All functionality now lives in Dala.Socket. New code should use Dala.Socket directly.

Summary

Functions

Assign multiple key/value pairs at once from a keyword list or map.

Assign a single key/value pair into the socket's assigns.

Check if specific key(s) have changed since the last render.

Clear the changed set after a render.

Get a value from the socket assigns.

Get a value from the internal __dala__ metadata.

Create a new socket for the given screen module.

Queue a pop_screen navigation action.

Queue a pop_to navigation action.

Queue a pop_to_root navigation action.

Queue a push_screen navigation action.

Put a value into the internal __dala__ metadata.

Store the root view ref in the socket.

Queue a reset_to navigation action.

Types

t()

@type t() :: Dala.Socket.t()

Functions

assign(socket, kw)

@spec assign(Dala.Socket.t(), keyword() | map()) :: Dala.Socket.t()

Assign multiple key/value pairs at once from a keyword list or map.

assign(socket, key, value)

@spec assign(Dala.Socket.t(), atom(), term()) :: Dala.Socket.t()

Assign a single key/value pair into the socket's assigns.

changed?(socket, keys)

@spec changed?(Dala.Socket.t(), atom() | [atom()]) :: boolean()

Check if specific key(s) have changed since the last render.

clear_changed(socket)

@spec clear_changed(Dala.Socket.t()) :: Dala.Socket.t()

Clear the changed set after a render.

get(socket, key, default \\ nil)

@spec get(Dala.Socket.t(), atom(), term()) :: term()

Get a value from the socket assigns.

get_dala(socket, key)

@spec get_dala(Dala.Socket.t(), atom()) :: term()

Get a value from the internal __dala__ metadata.

get_dala(socket, key, default)

@spec get_dala(Dala.Socket.t(), atom(), term()) :: term()

See Dala.Socket.get_dala/3.

new(screen, opts \\ [])

@spec new(
  module(),
  keyword()
) :: Dala.Socket.t()

Create a new socket for the given screen module.

pop_screen(socket)

@spec pop_screen(Dala.Socket.t()) :: Dala.Socket.t()

Queue a pop_screen navigation action.

pop_to(socket, dest)

@spec pop_to(Dala.Socket.t(), module() | atom()) :: Dala.Socket.t()

Queue a pop_to navigation action.

pop_to_root(socket)

@spec pop_to_root(Dala.Socket.t()) :: Dala.Socket.t()

Queue a pop_to_root navigation action.

push_screen(socket, dest, params \\ %{})

@spec push_screen(Dala.Socket.t(), module(), map()) :: Dala.Socket.t()

Queue a push_screen navigation action.

put_dala(socket, key, value)

@spec put_dala(Dala.Socket.t(), atom(), term()) :: Dala.Socket.t()

Put a value into the internal __dala__ metadata.

put_root_view(socket, view)

@spec put_root_view(Dala.Socket.t(), term()) :: Dala.Socket.t()

Store the root view ref in the socket.

reset_to(socket, dest, params \\ %{})

@spec reset_to(Dala.Socket.t(), module() | atom(), map()) :: Dala.Socket.t()

Queue a reset_to navigation action.