toolish - v0.2.5
    Preparing search index...

    Class ReactiveTimer

    Manages a reactive time value in seconds. Not recommended for use cases requiring high precision, custom timing logic is likely more suitable for that!

    Implements

    Index

    Constructors

    Properties

    Methods

    Constructors

    • Parameters

      • start: number = 0

        initial time; default = 0

      • updateIntervalMs: number = 100

        update interval in ms; default = 100

      Returns ReactiveTimer

    Properties

    time: Ref<number>

    Ref with the number of elapsed integer seconds. Can be freely updated to any desired integer value while running or paused, either directly or through reset.

    The fractional time (i.e. sub-second elapsed time) is not visible but maintained internally. It's important to note that this is retained during a pause. (e.g. if stopped at 3.5 seconds, the timer will reach 4 seconds only half a second after being resumed). One exception is when the user updates the ref value while paused, the fraction is reset to 0.

    Methods

    • Parameters

      • time: number = 0

      Returns this