Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Counter

Index

Constructors

Properties

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

Properties

Readonly isDefault

isDefault: boolean

Whether the counter is set as a default value.

Readonly value

value: number

The value of the counter.

Methods

increment

  • increment(amount: number): void
  • Increments the counter by amount, which can be any valid number. Only valid within the closure of Collection's {@link Collection.update | update()} method, otherwise an exception is thrown.

    Parameters

    • amount: number

    Returns void