public static Promise when ( Object ... d ) { int l = d . length ; Promise [ ] p = new Promise [ l ] ; for ( int i = 0 ; i < l ; i ++ ) { p [ i ] = makePromise ( d [ i ] ) ; } return when ( p ) ; }
Provides a way to execute callback functions based on one or more objects usually Deferred objects that represent asynchronous events .