Dala.ComponentServer (dala v0.6.0)

Copy Markdown View Source

Public API for component server operations.

This module delegates to Dala.Ui.NativeView.Server for managing component processes.

Summary

Functions

Deliver a native event to the component.

Get the persistent NIF handle allocated at mount time.

Get the current rendered props from the component.

Start a component process.

Update the component with new props from the parent screen re-render.

Functions

dispatch(pid, event, payload)

@spec dispatch(pid(), String.t(), map()) :: :ok

Deliver a native event to the component.

get_handle(pid)

@spec get_handle(pid()) :: integer()

Get the persistent NIF handle allocated at mount time.

render_props(pid)

@spec render_props(pid()) :: map()

Get the current rendered props from the component.

start(opts)

@spec start(keyword()) :: {:ok, pid()} | {:error, term()}

Start a component process.

update(pid, props)

@spec update(pid(), map()) :: :ok

Update the component with new props from the parent screen re-render.