LiveDebugger.Services.ChannelService (LiveDebugger v0.1.4)
View SourceThis module provides functions that performs operation on state of LiveView channel.
Summary
Functions
Creates a tree with LiveDebugger.Structs.TreeNode elements from the channel state.
Retrieves a TreeNode with the given id
from the channel state
The id
can be either a PID or a CID.
Returned node doesn't have children.
Returns node ids that are present in the channel state where node can be both LiveView or LiveComponent. For LiveView, the id is the PID of the process. For LiveComponent, the id is the CID.
Retrieves the state of the LiveView channel process identified by pid
.
Functions
@spec build_tree(channel_state :: LiveDebugger.CommonTypes.channel_state()) :: {:ok, LiveDebugger.Structs.TreeNode.t()} | {:error, term()}
Creates a tree with LiveDebugger.Structs.TreeNode elements from the channel state.
@spec get_node( channel_state :: LiveDebugger.CommonTypes.channel_state(), id :: LiveDebugger.Structs.TreeNode.id() ) :: {:ok, LiveDebugger.Structs.TreeNode.t() | nil} | {:error, term()}
Retrieves a TreeNode with the given id
from the channel state
The id
can be either a PID or a CID.
Returned node doesn't have children.
@spec node_ids(channel_state :: LiveDebugger.CommonTypes.channel_state()) :: {:ok, [LiveDebugger.Structs.TreeNode.id()]} | {:error, term()}
Returns node ids that are present in the channel state where node can be both LiveView or LiveComponent. For LiveView, the id is the PID of the process. For LiveComponent, the id is the CID.
@spec state(pid :: pid()) :: {:ok, LiveDebugger.CommonTypes.channel_state()} | {:error, term()}
Retrieves the state of the LiveView channel process identified by pid
.