View Source Protean.Context (Protean v0.1.0-alpha.1)

Snapshot of active states, assigns, and the latest event seen by the machine.

Functions in this module should rarely be used directly. Instead, rely on the API exposed by Protean and Protean.Action to query and modify machine context.

Link to this section Summary

Link to this section Types

@type assigns() :: %{required(any()) => any()}
Link to this opaque

private_state()

View Source (opaque)
@opaque private_state()
@type t() :: %Protean.Context{
  assigns: assigns(),
  event: Protean.event() | nil,
  final: value(),
  private: private_state(),
  value: value()
}
@type value() :: MapSet.t(Protean.Node.id())

Link to this section Functions

Link to this function

assign(context, updates)

View Source
@spec assign(t(), %{required(any()) => any()}) :: t()
@spec assign(t(), Enumerable.t()) :: t()
Link to this function

matches?(context, descriptor)

View Source
@spec matches?(t(), Protean.Node.id()) :: boolean()
@spec matches?(t(), String.t()) :: boolean()
@spec matches?(t(), atom()) :: boolean()