Package | weavejs.core |
Class | public class LinkablePromise |
Inheritance | LinkablePromise ![]() |
Implements | ILinkableObject, IDisposableObject |
See also
Property | Defined By | ||
---|---|---|---|
error : Object [read-only]
The error that occurred calling the invoke function. | LinkablePromise | ||
result : Object [read-only]
The result of calling the invoke function. | LinkablePromise |
Method | Defined By | ||
---|---|---|---|
LinkablePromise(task:Function, description:* = null, validateNow:Boolean = false) | LinkablePromise | ||
Registers dependencies of the LinkablePromise. | LinkablePromise | ||
dispose():void | LinkablePromise | ||
fromIterativeTask(initialize:Function, iterativeTask:Function, priority:uint, description:* = null, validateNow:Boolean = false):LinkablePromise [static]
Creates a LinkablePromise from an iterative task function. | LinkablePromise | ||
validate():void
If this LinkablePromise is set to lazy mode, this will switch it to non-lazy mode and automatically invoke the async task when necessary. | LinkablePromise |
error | property |
error:Object
[read-only] The error that occurred calling the invoke function. When this value is accessed, validate() will be called.
public function get error():Object
result | property |
result:Object
[read-only] The result of calling the invoke function. When this value is accessed, validate() will be called.
public function get result():Object
LinkablePromise | () | Constructor |
public function LinkablePromise(task:Function, description:* = null, validateNow:Boolean = false)
Parameters
task:Function — A function to invoke, which must take zero parameters and may return an AsyncToken.
| |
description:* (default = null ) — A description of the task as a String, or a function to call which returns a descriptive string.
Such a function has the signature function():String.
| |
validateNow:Boolean (default = false )
|
depend | () | method |
public function depend(dependency:ILinkableObject, ... otherDependencies):LinkablePromise
Registers dependencies of the LinkablePromise.
Parameters
dependency:ILinkableObject | |
... otherDependencies |
LinkablePromise |
dispose | () | method |
public function dispose():void
fromIterativeTask | () | method |
public static function fromIterativeTask(initialize:Function, iterativeTask:Function, priority:uint, description:* = null, validateNow:Boolean = false):LinkablePromise
Creates a LinkablePromise from an iterative task function.
Parameters
initialize:Function — A function that should be called prior to starting the iterativeTask.
| |
iterativeTask:Function — A function which is designed to be called repeatedly across multiple frames until it returns a value of 1.
| |
priority:uint — The task priority, which should be one of the static constants in WeaveAPI.
| |
description:* (default = null ) — A description of the task as a String, or a function to call which returns a descriptive string.
Such a function has the signature function():String.
| |
validateNow:Boolean (default = false )
|
LinkablePromise |
See also
validate | () | method |
public function validate():void
If this LinkablePromise is set to lazy mode, this will switch it to non-lazy mode and automatically invoke the async task when necessary.