Masu (枡) adds data grids to a Phoenix app.

It ships a prebuilt grid bundle and the components that render it: a grid that draws only the rows on the screen, asks the server for the rows it needs as you scroll, and sorts, filters and searches where the rows are, in a list or in your database, so a LiveView shows a hundred rows or a million the same way, with no Node.js build step of its own.

Start with the Quickstart, then the Columns and Sources guides. The main modules are Masu.Components (the grid), Masu.Column (what a column shows), Masu.Source (where the rows come from), Masu.Query (what a person asked for), Masu.Write (what a person changes, as your app saves it), Masu.Action (what your app does with rows) and Masu.Test (the test helpers).

Summary

Types

How a write or an action that went on later (async) went.

Functions

Says how far an action that went on later is: done of total, which the grid shows ("Archive: 300 of 1,204").

Says how a write (Masu.Write.async/1) or an action (:async, see Masu.Action) that went on later went, from any process: an Oban job, a task, on any node of the cluster. ref is the write's ref, or the action's context's.

Returns the current Masu version.

Types

reply()

@type reply() :: :ok | {:ok, String.t()} | {:error, String.t()}

How a write or an action that went on later (async) went.

Functions

progress(ref, done, total)

@spec progress(String.t(), non_neg_integer(), non_neg_integer()) :: :ok

Says how far an action that went on later is: done of total, which the grid shows ("Archive: 300 of 1,204").

reply(ref, result)

@spec reply(String.t(), reply()) :: :ok

Says how a write (Masu.Write.async/1) or an action (:async, see Masu.Action) that went on later went, from any process: an Oban job, a task, on any node of the cluster. ref is the write's ref, or the action's context's.

  • :ok - done; the grid reads its rows again;
  • {:ok, message} - done, and the grid says message;
  • {:error, message} - it failed: the grid says so, and the cells of a write show their old values again.

The grid may be gone (the person left): the reply then goes nowhere.

version()

@spec version() :: String.t()

Returns the current Masu version.

Examples

iex> Masu.version()
"0.7.0"