Skip to content

Runnable

Unofficial

A controllable task with start, stop, and cancel lifecycle.

Import:

import type { Runnable } from '@obsidian-typings/obsidian-public-latest';

Signature:

export interface Runnable

Properties

PropertyTypeDescription
cancelledbooleanWhether the runnable has been cancelled.
onCancel(() => void) | nullCallback invoked when the runnable is cancelled.
onStart(() => void) | nullCallback invoked when the runnable starts.
onStop(() => void) | nullCallback invoked when the runnable stops.
runningbooleanWhether the runnable is currently running.

Methods

MethodReturnsDescription
cancel()voidCancel the runnable.
isCancelled()booleanCheck whether the runnable has been cancelled.
isRunning()booleanCheck whether the runnable is currently running.
start()voidStart the runnable.
stop()voidStop the runnable.

Links to this page: