The basic building block for the resolve system.

Resolvables encapsulate a state's resolve's resolveFn, the resolveFn's declared dependencies, the wrapped (.promise), and the unwrapped-when-complete (.data) result of the resolveFn.

Resolvable.get() either retrieves the Resolvable's existing promise, or else invokes resolve() (which invokes the resolveFn) and returns the resulting promise.

Resolvable.get() and Resolvable.resolve() both execute within a context path, which is passed as the first parameter to those fns.

Constructors

Properties

data: any
deps: any
policy: any
promise: any
resolveFn: any
resolved: boolean
token: any

Methods

  • Gets a promise for this Resolvable's data.

    Fetches the data and returns a promise. Returns the existing promise if it has already been fetched once.

    Parameters

    • resolveContext: any
    • trans: any

    Returns any

  • Parameters

    • state: any

    Returns {
        async: any;
        when: any;
    }

    • async: any
    • when: any
  • Asynchronously resolve this Resolvable's data

    Given a ResolveContext that this Resolvable is found in: Wait for this Resolvable's dependencies, then invoke this Resolvable's function and update the Resolvable's state

    Parameters

    • resolveContext: any
    • trans: any

    Returns any