Dala.ComponentRegistry (dala v0.0.12)

Copy Markdown View Source

Public API for component registry operations.

This module delegates to Dala.Ui.NativeView.Registry for managing component processes in the UI tree.

Summary

Functions

Remove a component registration.

Look up the component pid for a given key.

Stop any component processes for screen_pid whose {id, module} key is NOT in active_keys. Called after each render to reap components that left the tree.

Register a component process.

Start the component registry.

Functions

deregister(screen_pid, id, module)

@spec deregister(pid(), atom(), module()) :: :ok

Remove a component registration.

lookup(screen_pid, id, module)

@spec lookup(pid(), atom(), module()) :: {:ok, pid()} | {:error, :not_found}

Look up the component pid for a given key.

reconcile(screen_pid, active_keys)

@spec reconcile(pid(), MapSet.t()) :: :ok

Stop any component processes for screen_pid whose {id, module} key is NOT in active_keys. Called after each render to reap components that left the tree.

register(screen_pid, id, module, component_pid)

@spec register(pid(), atom(), module(), pid()) :: :ok

Register a component process.

Raises if the same {screen_pid, id, module} is already registered (duplicate id on the same screen).

start_link(opts \\ [])

@spec start_link(keyword()) :: GenServer.on_start()

Start the component registry.