Macaw.Component.Mode (macaw_component v0.1.2)

Copy Markdown View Source

The rendering modes and what each allows (spec/02 §3).

iex> Macaw.Component.Mode.allows?(:socketless, :hooks)
true
iex> Macaw.Component.Mode.allows?(:neutral, :live_regions)
false

Summary

Functions

The four modes, in order.

Whether a mode allows a feature. An unknown mode or feature raises ArgumentError: it is a programming error, not data.

The features a mode may allow, in order.

Types

t()

@type t() :: :live | :socketless | :neutral | :print

Functions

all()

@spec all() :: [t(), ...]

The four modes, in order.

allows?(mode, feature)

@spec allows?(t(), atom()) :: boolean()

Whether a mode allows a feature. An unknown mode or feature raises ArgumentError: it is a programming error, not data.

features()

@spec features() :: [atom(), ...]

The features a mode may allow, in order.