TourKit
@tour-kit/checklistsUtilities

Progress Utilities

Progress calculation utilities: compute completion percentages, remaining task counts, and estimated time to finish values

Progress Utilities

Functions for working with checklist progress.

calculateProgress

Calculate progress for a checklist:

import { calculateProgress } from '@tour-kit/checklists';

const progress = calculateProgress(checklistState);
// { completed: 3, total: 5, percentage: 60, remaining: 2 }

getNextTask

Get the next incomplete, unlocked task:

import { getNextTask } from '@tour-kit/checklists';

const nextTask = getNextTask(checklistState);
if (nextTask) {
  console.log('Next:', nextTask.config.title);
}

getLockedTasks

Get all tasks locked by dependencies:

import { getLockedTasks } from '@tour-kit/checklists';

const locked = getLockedTasks(checklistState);
console.log(`${locked.length} tasks locked`);

On this page