TinyTick logoTinyTick

getManagerConfig

The getManagerConfig method returns the current configuration of the Manager as a whole.

getManagerConfig<WithDefaults>(withDefaults?: WithDefaults): WithDefaults extends true ? ManagerConfigWithDefaults : ManagerConfig
TypeDescription
withDefaults?WithDefaults

An optional boolean indicating whether to return the full configuration, including defaults.

returnsWithDefaults extends true ? ManagerConfigWithDefaults : ManagerConfig

The configuration as a ManagerConfig or ManagerConfigWithDefaults.

You can either return just the configuration you have set, or the full configuration, including any defaults of those you have not provided.

Example

This example creates a Manager object and gets its default configuration. No additional configuration has been provided, so when the withDefaults flag is not set, the object returned is empty.

import {createManager} from 'tinytick';

const manager = createManager();

console.log(manager.getManagerConfig(true));
// -> {tickInterval: 100}
console.log(manager.getManagerConfig());
// -> {}

Since

v1.0.0