The socket struct passed through all Dala.Screen and Dala.Component callbacks.
Holds two things:
assigns— the public data map yourrender/1function reads from@assigns__dala__— internal Dala metadata (screen module, platform, view refs, nav stack)
You interact with a socket via assign/2 and assign/3. Never mutate __dala__
directly — it is an internal contract.
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 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 returned by the renderer into __dala__.root_view.
Called internally after the initial render.
Queue a reset_to navigation action.
Types
Functions
Assign multiple key/value pairs at once from a keyword list or map.
socket = assign(socket, count: 0, name: "test")
socket = assign(socket, %{count: 0})
Assign a single key/value pair into the socket's assigns.
socket = assign(socket, :count, 0)
Check if specific key(s) have changed since the last render.
Returns true if all keys were assigned since the last render.
Accepts a single atom or a list of atoms.
Clear the changed set after a render.
Called internally after rendering to reset the change tracking.
Get a value from the internal __dala__ metadata.
Used internally by the screen process.
Create a new socket for the given screen module.
Options:
:platform—:android(default) or:ios
Queue a pop_screen navigation action.
Pops the current screen from the navigation stack.
Queue a pop_to navigation action.
Pops screens until the target module is at the top of the stack.
Queue a pop_to_root navigation action.
Pops all screens except the root.
Queue a push_screen navigation action.
The screen process will process this on the next render cycle.
Put a value into the internal __dala__ metadata.
Used internally by the screen process.
Store the root view ref returned by the renderer into __dala__.root_view.
Called internally after the initial render.
Queue a reset_to navigation action.
Replaces the entire navigation stack with a fresh screen.