Skip to content

Runnable

Unofficial

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

Import:

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

Signature:

export interface Runnable

Properties

Property Type Description
cancelled boolean Whether the runnable has been cancelled.
onCancel (() => void) | null Callback invoked when the runnable is cancelled.
onStart (() => void) | null Callback invoked when the runnable starts.
onStop (() => void) | null Callback invoked when the runnable stops.
running boolean Whether the runnable is currently running.

Methods

Method Returns Description
cancel() void Cancel the runnable.
isCancelled() boolean Check whether the runnable has been cancelled.
isRunning() boolean Check whether the runnable is currently running.
start() void Start the runnable.
stop() void Stop the runnable.

Links to this page: