InterfacePathProvider

An interface for objects that provide a path.

This interface allows objects to provide a path that can change over time, with subscribers being notified of changes.

interface PathProvider {
    currentPath: null | Path;
    subscribeToPath(callback: ((path: null | Path) => void)): (() => void);
}

Implemented by

Properties

Methods

Properties

currentPath: null | Path

The current path, or null if no path is available.

Methods

  • Subscribes to path updates.

    Parameters

    • callback: ((path: null | Path) => void)

      The callback to call when the path changes.

        • (path): void
        • Parameters

          Returns void

    Returns (() => void)

    A function to unsubscribe from the path updates.

      • (): void
      • Returns void