setManagerConfig
The setManagerConfig
method lets you configure the Manager
as a whole.
setManagerConfig(config: ManagerConfig): Manager
Type | Description | |
---|---|---|
config | ManagerConfig | The |
returns | Manager | A reference to the |
This includes a property which lets you indicate the tickInterval
. This represents the time between Manager
'ticks' - essentially the heartbeat of how often the Manager
should check for new tasks to run, or existing ones to abort.
Examples
This example creates a Manager
object and sets its configuration.
import {createManager} from 'tinytick';
const manager = createManager();
manager.setManagerConfig({tickInterval: 200});
console.log(manager.getManagerConfig());
// -> {tickInterval: 200}
This example creates a Manager
object with some invalid configuration items (which are ignored).
import {createManager} from 'tinytick';
const manager = createManager();
manager.setManagerConfig({
tickInterval: -2000, // should be a positive integer
oops: 42, // not a valid configuration item
});
console.log(manager.getManagerConfig());
// -> {}
Since
v1.0.0