Options
All
  • Public
  • Public/Protected
  • All
Menu

Helper class for creating a Promise that is paired with a single-value callback.

    const pvc = new PromiseAndValueCallback<string>();
pvc.callback("a");
const result = await pvc.promise; // returns "a"

Type parameters

  • T

Hierarchy

  • PromiseAndValueCallback

Index

Constructors

Properties

Constructors

Properties

callback: (value: T) => void

Type declaration

    • (value: T): void
    • A callback function taking a single value; when it is called, promise is resolved with that value.

      Parameters

      • value: T

      Returns void

promise: Promise<T>

A Promise that will be resolved when callback is called.

Generated using TypeDoc