TinyTick logoTinyTick

getStatus

The getStatus method returns the current status of the Manager.

getStatus(): ManagerStatus
returnsManagerStatus

The status of the Manager.

This returns a simple numeric value that indicates whether the Manager is stopped (0), running (1), or stopping (2).

Example

This example demonstrates getting the status of a Manager as it transitions through different states.

import {createManager} from 'tinytick';

const manager = createManager();
console.log(manager.getStatus());
// -> 0

manager.start();
console.log(manager.getStatus());
// -> 1

manager.stop();
console.log(manager.getStatus());
// -> 2

manager.stop(true); // force stop
console.log(manager.getStatus());
// -> 0

Since

v1.0.0