Namespace: SnapshotSource

SnapshotSource

Enables configuring a SnapshotSource with custom getSnapshot and applySnapshot methods.

Methods

(async, static) init(provider) → {Promise.<void>}

Initializes a SnapshotSource with the getSnapshot and applySnapshot methods defined.

Parameters:
Name Type Description
provider SnapshotProvider
Tutorials:
Returns:
Type
Promise.<void>

(async, static) wrap(identity) → {Promise.<SnapshotSource>}

Asynchronously returns a SnapshotSource object that represents the current SnapshotSource.

Parameters:
Name Type Description
identity Identity
Tutorials:
Returns:
Type
Promise.<SnapshotSource>

(static) wrapSync(identity) → {SnapshotSource}

Synchronously returns a SnapshotSource object that represents the current SnapshotSource.

Parameters:
Name Type Description
identity Identity
Tutorials:
Returns:
Type
SnapshotSource

(async) applySnapshot() → {Promise.<void>}

Call the SnapshotSource's applySnapshot method defined by init.

Returns:
Type
Promise.<void>

(async) getSnapshot() → {Promise.<any>}

Call the SnapshotSource's getSnapshot method defined by init.

Returns:
Type
Promise.<any>

(async) ready() → {Promise.<void>}

Method to determine if the SnapshotSource has been initialized.

Use when the parent application is starting up to ensure the SnapshotSource is able to accept and apply a snapshot using the applySnapshot method.

Tutorials:
Returns:
Type
Promise.<void>