@yorkie-js/sdk
    Preparing search index...

    Class Counter

    Counter is a numeric counter that supports increase(). For counting unique actors, use DedupCounter instead.

    // Type is inferred from value:
    root.count = new Counter(0); // Int
    root.count = new Counter(0n); // Long

    Hierarchy

    • BaseCounter
      • Counter
    Index

    Constructors

    Properties

    context?: ChangeContext<Indexable>
    counter?: CRDTCounter
    value: number | bigint
    valueType: CounterType

    Methods

    • ensureInitialized throws if this counter has not been initialized.

      Returns void

    • initialize links this proxy to a ChangeContext and CRDTCounter.

      Parameters

      • context: ChangeContext
      • counter: CRDTCounter

      Returns void