This constructor creates a Resolvable copy
var resolvable1 = new Resolvable('mytoken', http => http.get('foo.json').toPromise(), [Http]);
var resolvable2 = new Resolvable(UserService, dep => new UserService(dep.data), [SomeDependency]);
var resolvable1Clone = new Resolvable(resolvable1);
This constructor creates a new Resolvable from the plain old ResolvableLiteral javascript object
var resolvable1 = new Resolvable('mytoken', http => http.get('foo.json').toPromise(), [Http]);
var resolvable2 = new Resolvable(UserService, dep => new UserService(dep.data), [SomeDependency]);
var resolvable1Clone = new Resolvable(resolvable1);
This constructor creates a new Resolvable
var resolvable1 = new Resolvable('mytoken', http => http.get('foo.json').toPromise(), [Http]);
var resolvable2 = new Resolvable(UserService, dep => new UserService(dep.data), [SomeDependency]);
var resolvable1Clone = new Resolvable(resolvable1);
The new resolvable's injection token, such as "userList"
(a string) or UserService
(a class).
When this token is used during injection, the resolved value will be injected.
The function that returns the resolved value, or a promise for the resolved value
An array of dependencies, which will be injected into the resolveFn
the ResolvePolicy defines when and how the Resolvable is processed
Pre-resolved data. If the resolve value is already known, it may be provided here.
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.
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
Generated using TypeDoc
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.