Skip to content

AndersDJohnson/actionscript-async

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

actionscript-async

Async utilities for ActionScript, in the style of the async module for Node.js.

Possible alternative to AS3Commons Async.

import com.AndersDJohnson.async.Async;

// ...

Async.tasks( [
  function ( callback:Function):void {
    // ...
    callback( null /* , ... args */ );
  },
  function ( callback:Function):void {
    // ...
    callback( null /* , ... args */ );
  }
  // ...
], function ( error:Error, results:Array ) {
  // results is now an array with results passed to each task function's callback
}

Examples

import com.AndersDJohnson.async.Async;

// ...

Async.tasks( [
  function ( callback:Function):void {
    callback( null, 'one', 1 );
  },
  function ( callback:Function):void {
    callback( null, 'two', 2 );
  }
], function ( error:Error, results:Array ) {
  // results is now equal to [ ['one', 1], ['two', 2] ] 
}

About

Async utilities for ActionScript.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published