Interface: PluginStore<T>
Defined in: model/plugin.ts:32
A plugin's own per-entry data, namespaced by that plugin's id. It is a real store, not a side map:
a write joins the open transaction, lands in the same ChangeSet as the entry edit, and one undo
step covers both. A write with no transaction open wraps itself in one, the rule entries.add
already follows.
A row belongs to one Entry. Removing the Entry removes its rows in the same ChangeSet, and an
undo brings both back.
Extends
Type Parameters
T
T extends object
Properties
all
readonlyall:ReadonlyMap<EntryId,T>
Defined in: model/plugin.ts:20
Inherited from
Methods
get()
get(
id):T|undefined
Defined in: model/plugin.ts:19
Parameters
id
string | EntryId
Returns
T | undefined
Inherited from
remove()
remove(
id):void
Defined in: model/plugin.ts:37
Removes id's row. An id with no row writes nothing.
Parameters
id
string | EntryId
Returns
void
set()
set(
id,value):void
Defined in: model/plugin.ts:35
Writes id's row. Throws EntryNotFoundError for an id with no Entry, as the open transaction
leaves it — the rule entries.update follows.
Parameters
id
string | EntryId
value
T
Returns
void
syncAll()
syncAll(
rows):void
Defined in: model/plugin.ts:48
Makes the store hold exactly rows: it writes a changed row, adds a new one, and removes a row
that rows leaves out. It records no undo step and erases no Redo, as entries.syncAll does,
because a refresh from outside is not the user's own edit. Nothing changes, and no change set lands, when
every row is the same object the store holds (a row compares by identity).
It is all or nothing. An id with no Entry throws EntryNotFoundError and writes nothing. It
throws TransactionAlreadyOpenError inside a transaction, and MutationDuringNotificationError
inside a change handler.
Parameters
rows
ReadonlyMap<string | EntryId, T>
Returns
void