• Sometimes it may be useful to have a promise that we can resolve from the outside. While this is not a pattern I'd encourage it can be useful in a few situations. This class is inspired by the angularjs $q Defer objects

    Type Parameters

    • T

    Returns DeferObj<T>

    Example

    export async function deferExample() {
    const d = defer<boolean>();
    mockLoadPerson2().then((p) => d.resolve(p));
    return d.promise;
    }

Generated using TypeDoc