View Source Yex.SharedType (y_ex v0.7.1)
The SharedType protocol defines the behavior of shared types in Yex.
Summary
Functions
Registers a change observer that will be message every time this shared type is modified.
Registers a change observer that will be message every time this shared type or any of its children is modified.
Unobserve the shared type for changes.
Unobserve the shared type for changes.
Types
Functions
Registers a change observer that will be message every time this shared type is modified.
If the shared type changes, a message is delivered to the monitoring process in the shape of:
{:observe_event, ref, event, origin, metadata}
where:
ref
is a monitor reference returned by this function;event
is a struct that describes the change;origin
is the origin passed to theYex.Doc.transaction()
function.metadata
is the metadata passed to theobserve
function.
Options
:metadata
- provides metadata to be attached to this observe.
Registers a change observer that will be message every time this shared type or any of its children is modified.
If the shared type changes, a message is delivered to the monitoring process in the shape of:
{:observe_deep_event, ref, events, origin, metadata}
where:
ref
is a monitor reference returned by this function;events
is a array of event struct that describes the change;origin
is the origin passed to theYex.Doc.transaction()
function.metadata
is the metadata passed to theobserve_deep
function.
Options
:metadata
- provides metadata to be attached to this observe.
@spec unobserve(reference()) :: :ok
Unobserve the shared type for changes.
@spec unobserve_deep(reference()) :: :ok
Unobserve the shared type for changes.