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

    Interface Store

    Where records live. One method, and it MUST be atomic: read the record for (scope, id), run decide on it, and if the answer is apply, write the record that recordFor returns, all as one operation. Anything less lets two events for one entity both pass.

    To keep the record and your own write together, run advance inside the same database transaction as your write, so a failed write rolls the record back too. checkStore runs the contract against an implementation.

    interface Store {
        advance(event: StoreEvent, rules: Rules): Promise<Decision>;
    }

    Implemented by

    Index