Visualize.Chart.Builder.Bundle (Visualize v0.2.35)

Copy Markdown View Source

A collection of entries that can cross from one store into another (spec/14 §19.7).

Export takes the closure. Exporting an entry exports every entry it refers to, transitively, with their ids, so an import cannot dangle by construction. The bundle carries provenance — which store it came from, and when — and each entry keeps its original id, so a repeated import of the same collection is detectable rather than a second copy of everything.

Importing one is the store's import/2 callback: a relocation through one old => new table, committed whole or not at all (D-103).

This module compiles only when Phoenix.Component is loaded (spec/10 §1.1, D-45, D-85).

Summary

Types

Where a bundle came from, and when.

t()

Functions

The closure of an id through a store: the entry, and every entry it refers to, transitively, each once, in dependency order — an entry after everything it refers to.

Types

provenance()

@type provenance() :: %{store: term(), exported_at: DateTime.t()}

Where a bundle came from, and when.

t()

@type t() :: %Visualize.Chart.Builder.Bundle{
  entries: [Visualize.Chart.Builder.Store.entry()],
  provenance: provenance()
}

Functions

export(store, ids, source)

The closure of an id through a store: the entry, and every entry it refers to, transitively, each once, in dependency order — an entry after everything it refers to.

source names the store in the provenance; it is the host's to choose and the store is never asked. An id the store does not hold is skipped: it was a mask before export and stays one after import (§19.2).