Interface ViewStateLockingDeduplicationRepository<E, S, EV, SV>

View State Locking and Deduplication repository interface

Author

Иван Дугалић / Ivan Dugalic /

Idugalic

interface ViewStateLockingDeduplicationRepository {
    fetchState: ((e) => Promise<readonly [null | S, null | SV]>);
    save: ((s, eventVersion, currentStateVersion) => Promise<readonly [S, SV]>);
}

Type Parameters

  • E

    Event

  • S

    State

  • EV

    Version of the event

  • SV

    Version of the state

Hierarchy

Properties

Properties

fetchState: ((e) => Promise<readonly [null | S, null | SV]>)

Type declaration

    • (e): Promise<readonly [null | S, null | SV]>
    • Fetch state

      Parameters

      • e: E

        Event of type E

      Returns Promise<readonly [null | S, null | SV]>

      current state of type [S , SV]

save: ((s, eventVersion, currentStateVersion) => Promise<readonly [S, SV]>)

Type declaration

    • (s, eventVersion, currentStateVersion): Promise<readonly [S, SV]>
    • Save state

      Parameters

      • s: S

        State of type S

      • eventVersion: EV

        Event version of type EV

      • currentStateVersion: null | SV

        State version of type SV | null

      Returns Promise<readonly [S, SV]>

      newly saved State of type [S, V]

Generated using TypeDoc