Vladimir Dashukevich
Vladimir Dashukevich
loginPromise.done(f1) === loginPromise
loginPromise.then(f1, f2) !== loginPromise
new Promise(function(resolve, reject){
//resolve(results)
//reject(error)
});
(new Promise())
.then(loadImages)
.then(loadSounds)
.then(loadData)
.then(startGame)
all([loadImages(), loadSounds(), loadData()])
.then(startGame)
race([loadImages(), loadSounds(), loadData()])
.then(startGame)
(new Promise())
.then(loadImages)
.then(renderImages)
.then(all([loadSound1(), loadSound2(), loadSound3()]))
.then(loadData)
.then(startGame)
(new Promise())
.then(getTrips, errorCallback)
.then(getCountries, errorCallback)
.then(getHotels, errorCallback)
.then(getRooms, errorCallback)
getHotels()
.then(doSmth, errorCallback)
var gen = function* count(){
for (var x = 0; true; x++) {
yield x
}
}
var a = gen()
a.next(); // => 0
a.next(); // => 1
a.next(); // => 2
function* showFeed(){
var countries = yield getCountries();
renderCountries(countries);
var hotels = yield getHotels();
renderHotels(hotels);
var rooms = yield getRooms();
renderRooms(rooms);
}