PersisterListener
A PersisterListener
is a generic representation of the callback that lets a Persister
inform the store that a change has happened to the underlying data.
(
content?: PersistedContent<Persist>,
changes?: PersistedChanges<Persist>,
): void
Type | Description | |
---|---|---|
content? | PersistedContent<Persist> | If provided, this is a |
changes? | PersistedChanges<Persist> | If provided, this is a |
returns | void | This has no return value. |
Using the values of the Persists
enum, the generic parameter indicates whether the Persister
is handling content and changes from a regular Store
, a MergeableStore
, or either.
If the listener is called with the changes
parameter, it will be used to make an incremental change to the Store
. If not, but the content
parameter is available, that will be used to make a wholesale change to the Store
. If neither are present, the content will be loaded using the Persister
's load
method. Prior to v5.0, these parameters were callbacks and the overall type was non-generic.
Since
v4.0.0