Creates an event emitter instance to listen for the actions
Call the function to remove the event
Gets as any arguments as it needs
Creates an event emitter instance to listen for the actions
Call the function to remove the event
Creates an event emitter instance to listen for the actions
Call the function to remove the event
Gets as any arguments as it needs
Creates an event emitter instance to listen for the actions
Call the function to remove the event
Removes the specified event and invokes the callback after it is removed
Optional
callback: EventListenerCallbackAdds the listener function to the beginning of the listeners array for the event named eventName. No checks are made to see if the listener has already been added. Multiple calls passing the same combination of eventName and listener will result in the listener being added, and called, multiple times.
Adds a one-time listener function for the event named eventName to the beginning of the listeners array. The next time eventName is triggered, this listener is removed, and then invoked.
Attempts to cancel execution of this task. For Android, This attempt will fail if the task has already completed, already been cancelled, or could not be cancelled for some other reason. For Android, If successful, and this task has not started when cancel is called, this task should never run. If the task has already started, then the mayInterruptIfRunning parameter determines whether the thread executing this task should be interrupted in an attempt to stop the task.
3.2.2
false For Android, if the task could not be cancelled, typically because it has already completed normally; true otherwise.
Readonly
iosReadonly
androidRuns on the UI thread before onComplete.
onPreExecute
3.2.2
import AsyncTask from '@smartface/native/global/asynctask';
const task = new AsyncTask();
task.on(AsyncTask.Events.PreExecute, () => {
console.info('onPreExecute');
});
Runs on the UI thread after cancel() is invoked
onCancelled
3.2.2
import AsyncTask from '@smartface/native/global/asynctask';
const task = new AsyncTask();
task.on(AsyncTask.Events.Cancelled, () => {
console.info('onCancelled');
});
This event describes task of AsyncTask instance.
task
3.1.0
This event invokes when task is completed.
onComplete
3.1.0
import AsyncTask from '@smartface/native/global/asynctask';
const task = new AsyncTask();
task.on(AsyncTask.Events.Complete, () => {
console.info('onComplete');
});
Generated using TypeDoc
Since
3.1.0 AsyncTask enables proper and easy use of concurrency to improve speed and performance.
Example