API Reference live_slice v#0.2.1

Copy Markdown View Source

Modules

Server side of live_slice: binds a LiveView to a client-side store.

The server actions of a store, defined once and handled in every LiveView that attaches the module, so a store's queued actions drain on every page that renders its bridge, not only on the pages whose LiveView declares the store with use LiveSlice.

The server side of collaborative keys: one process per document, holding a Yjs document (Yex.Doc, from the optional dependency y_ex) that the clients of every LiveView showing it sync with. See "Collaborative keys" in LiveSlice and the Collaborative keys guide.

The default persistence of LiveSlice.CRDT: documents, their generations and the metadata of their last delete are kept in an ETS table owned by the server's supervisor, so they outlive their document processes but not the server. For demos and tests only: a restart or a deploy loses every document (clients that still hold one send it back on their next sync, see "Offline, tabs and restarts" in the Collaborative keys guide) and forgets every delete (a client that still holds a deleted document sends it back too).

Where LiveSlice.CRDT keeps its documents between document processes.

A small binary columnar format for flat records, decoded in the browser by decodeColumns and columnsDecoder from live_slice/data.

Serves the service worker of live_slice/sw and tells it what to precache.