Options
All
  • Public
  • Public/Protected
  • All
Menu

Represents a counter that can be part of a DocumentValue and incremented during document updates.

Hierarchy

  • Counter

Index

Constructors

Methods

Constructors

constructor

  • new Counter(value: number, isDefault?: boolean): Counter
  • Creates a new counter with an initial value that can be used as part of a document's content.

    Parameters

    • value: number
    • Optional isDefault: boolean

      Represents whether or not the value should be set as a default value. Set this to true if you want to set a default value that you expect to be overwritten by other devices in the network. The default value is false.

    Returns Counter

Methods

increment

  • increment(amount: number): void
  • Increments the counter by amount, which can be any valid number.

    Parameters

    • amount: number

    Returns void