View Source Yex.Doc (y_ex v0.5.1)

Summary

Functions

Stop monitoring document updates.

Get or insert the array type.

Get or insert the map type.

Get or insert the text type.

Monitor document updates.

Create a new document.

Start a transaction.

Create a new document with options.

Types

@type t() :: %Yex.Doc{reference: any()}

Functions

Stop monitoring document updates.

Link to this function

demonitor_update_v1(sub)

View Source
Link to this function

demonitor_update_v2(sub)

View Source

Get or insert the array type.

Get or insert the map type.

Get or insert the text type.

Monitor document updates.

Create a new document.

Start a transaction.

Examples

iex> doc = Doc.new()
iex> text = Doc.get_text(doc, "text")
iex> Yex.Doc.monitor_update(doc)
iex> Doc.transaction(doc, fn ->
iex>   Text.insert(text, 0, "Hello")
iex>   Text.insert(text, 0, "Hello", %{"bold" => true})
iex> end)
iex> assert_receive {:update_v1, _, nil, _}
iex> refute_receive {:update_v1, _, nil, _} # only one update message
Link to this function

transaction(doc, origin, exec)

View Source

Create a new document with options.