# Class TaskTracker

A factory function to create `TaskTracker` instances.

A `TaskTracker` tracks pending tasks (grouped by type) and notifies interested parties when all pending tasks (or tasks of a specific type) have been completed.

- Defined in core/task-tracker-factory.js:20

#####
Index

### Constructors

constructor

### Properties

ALL_TASKS_TYPE
DEFAULT_TASK_TYPE

### Methods

completeTask
incTaskCount
notifyWhenNoPendingTasks

##
Constructors

### constructor

- new TaskTracker(log): TaskTracker

- #### Parameters

  - log: LogService

    The logging service.

  #### Returns TaskTracker

  - Defined in core/task-tracker-factory.js:24

##
Properties

### ALL_TASKS_TYPE

ALL_TASKS_TYPE: string

Special task types used for tracking all tasks and default tasks.

- Defined in core/task-tracker-factory.js:38

### DEFAULT_TASK_TYPE

DEFAULT_TASK_TYPE: string

Default task type.

- Defined in core/task-tracker-factory.js:44

##
Methods

### completeTask

- completeTask(fn, taskType?): void

- Completes a task and decrements the associated task counter. If the counter reaches 0, all corresponding callbacks are executed.

  #### Parameters

  - fn: Function

    The function to execute when completing the task.

  - `Optional` taskType: string = ...

    The type of task being completed.

  #### Returns void

  - Defined in core/task-tracker-factory.js:54

### incTaskCount

- incTaskCount(taskType?): void

- Increments the task count for the specified task type.

  #### Parameters

  - `Optional` taskType: string = ...

    The type of task whose count will be increased.

  #### Returns void

  - Defined in core/task-tracker-factory.js:89

### notifyWhenNoPendingTasks

- notifyWhenNoPendingTasks(callback, taskType?): void

- Registers a callback to be executed when all pending tasks of the specified type are completed. If there are no pending tasks of the specified type, the callback is executed immediately.

  #### Parameters

  - callback: Function

    The function to execute when no pending tasks remain.

  - `Optional` taskType: string = ...

    The type of tasks to wait for completion.

  #### Returns void

  - Defined in core/task-tracker-factory.js:102