I am trying to use ecma6 promise to rewrite that simpel $.when
var d1 = $.Deferred();
var d2 = $.Deferred();
$.when( d1, d2 ).done(function ( v1, v2 ) {
console.log( v1 ); // "Fish"
console.log( v2 ); // "Pizza"
});
d1.resolve( "Fish" );
d2.resolve( "Pizza" );
Any way to use new Promise ?
regards
The goal is to RESOLVE the promise OUTSIDE the scope of the promise.