Dala.Socket (dala v0.0.10)

Copy Markdown View Source

Public API for socket operations.

This module delegates to Dala.Ui.Socket for socket functionality.

Summary

Functions

Assign multiple values to the socket.

Assign a value to the socket.

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

Get a value from the socket assigns.

Get the Dala metadata from the socket.

Create a new socket for a screen module.

Put Dala metadata into the socket.

Store the root view ref in the socket.

Functions

assign(socket, assigns)

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

Assign multiple values to the socket.

assign(socket, key, value)

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

Assign a value to the socket.

changed?(socket, keys)

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

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

get(socket, key, default \\ nil)

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

Get a value from the socket assigns.

get_dala(socket, key, default \\ nil)

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

Get the Dala metadata from the socket.

new(screen_module, opts \\ [])

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

Create a new socket for a screen module.

pop_screen(socket)

See Dala.Ui.Socket.pop_screen/1.

pop_to(socket, dest)

See Dala.Ui.Socket.pop_to/2.

pop_to_root(socket)

See Dala.Ui.Socket.pop_to_root/1.

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

See Dala.Ui.Socket.push_screen/3.

put_dala(socket, key, value)

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

Put Dala metadata into the socket.

put_root_view(socket, view)

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

Store the root view ref in the socket.

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

See Dala.Ui.Socket.reset_to/3.