SnapshotManager
Defines the functionality needed for handling snapshots.
Constructor Summary
Public Constructor | ||
public |
|
Method Summary
Public Methods | ||
public |
[Symbol.iterator](): Iterator<Snapshot> Returns an iterator over the snapshots. |
|
public |
abortSnapshot(snapshot: Snapshot): boolean Aborts a snapshot. |
|
public |
async applyTx(tx: Transaction, backend: IObjectStore): Promise Updates the snapshots managed by this class. |
|
public |
createSnapshot(objectStore: ObjectStore, backend: IObjectStore): Snapshot Creates an in-memory snapshot of the current state. |
Public Constructors
public constructor() source
Public Methods
public abortSnapshot(snapshot: Snapshot): boolean source
Aborts a snapshot.
Params:
Name | Type | Attribute | Description |
snapshot | Snapshot |
Return:
boolean | A promise of the success outcome. |
public async applyTx(tx: Transaction, backend: IObjectStore): Promise source
Updates the snapshots managed by this class.
Params:
Name | Type | Attribute | Description |
tx | Transaction | The transaction to apply. |
|
backend | IObjectStore |
Return:
Promise | The promise resolves after applying the transaction. |
public createSnapshot(objectStore: ObjectStore, backend: IObjectStore): Snapshot source
Creates an in-memory snapshot of the current state. This snapshot only maintains the differences between the state at the time of the snapshot and the current state. To stop maintaining the snapshot, it has to be aborted.
Params:
Name | Type | Attribute | Description |
objectStore | ObjectStore | ||
backend | IObjectStore |