burying-beetle - v0.1.0
    Preparing search index...

    Class Guard

    Decides, per entity, whether an event is the newest one, and records it if so. Construct it next to the store it uses; it holds no state of its own.

    const decision = await guard.advance({ scope: "github", id: issue.node_id, version: [updatedAtMs, deliverySeq], kind: "write" });
    if (decision === "apply") await saveIssue(issue);
    Index
    • Decides and records one event. On apply, make your write; run this in the same transaction as that write when your store can. An error from the store is rethrown unchanged.

      Parameters

      Returns Promise<Decision>