Skip to main content
Module

x/prevalence/mod.ts>Persister

Prevalence for Deno, like Prevayler.
Latest
interface Persister
import { type Persister } from "https://deno.land/x/prevalence@0.1.2/mod.ts";

Methods

loadModel(defaultInitialModel: M): Promise<M>

Load the model from the persister.

loadJournal(): Promise<JournalEntry<M>[]>

Load the journal from the persister.

appendToJournal(journalEntry: JournalEntry<M>): Promise<Action<M>>

Append an entry to the journal.

saveModelAndClearJournal(model: M, lastAppliedTimestamp: LastAppliedTimestamp): Promise<void>

Save the model to the persister, and clear the journal, atomically.

loadLastAppliedTimestamp(): Promise<number | null>

Load the last applied timestamp from the persister.