API Docs for: 1.3.12
Show:

EcAsyncHelper Class

Pattern (probably similar to Promise) that provides fine grained control over asynchronous execution. Will iterate over all items in an array and perform 'each(item,callback)'. Every 'each' needs to call the callback. This callback can be passed down through several asynchronous calls. When all callbacks have been called, 'after(array)' is called.

Item Index

Properties

Methods

each

(
  • array
  • each
  • after
)

"Each" method. See class description.

Parameters:

  • array Array

    Array to iterate over.

  • each Function(item,callback)

    Method that gets invoked per item in the array.

  • after Function(array)

    Method invoked when all callbacks are called.

each

(
  • array
  • each
  • after
)

"Each" method. Allows for replacing values in the array. See class description.

Parameters:

  • array Array

    Array to iterate over.

  • each Function(item,callback)

    Method that gets invoked per item in the array.

  • after Function(array)

    Method invoked when all callbacks are called.

isStopped

()

Is preventing 'after' from being called?

Returns:

whether it is stopped.

stop

()

Stops any remaining objects from being iterated over, if they have not already. Will prevent 'after' from being called.

stop

()

Stops any remaining objects from being iterated over, if they have not already. Will allow 'after' to be called.

Properties

counter

Integer

Counter that counts down when each callback is called. Lots of tricks can be done to cause after to proc in different ways.