resolve-all.js 374 B

1234567891011121314151617181920
  1. 'use strict'
  2. function resolveAll(constructs, events, context) {
  3. var called = []
  4. var index = -1
  5. var resolve
  6. while (++index < constructs.length) {
  7. resolve = constructs[index].resolveAll
  8. if (resolve && called.indexOf(resolve) < 0) {
  9. events = resolve(events, context)
  10. called.push(resolve)
  11. }
  12. }
  13. return events
  14. }
  15. module.exports = resolveAll