Skip to content

Instantly share code, notes, and snippets.

@ermst4r
Created November 30, 2017 07:36
Show Gist options
  • Save ermst4r/1011e2c392645683328c32ac0b0b3b98 to your computer and use it in GitHub Desktop.
Save ermst4r/1011e2c392645683328c32ac0b0b3b98 to your computer and use it in GitHub Desktop.
promise example
var bid_type = method.populateBidType(bid);
var new_bid = bid.bid + 1;
Profilebot.generateRandomAutobotId(bid.fk_profile_bot_id).then(function (bot) {
return bot;
}).then(function (bot) {
var insert_data = ProfileBid.prepareInsertData(bid.fk_user_id, bot.bot_id, item.id, new_bid, bid_type);
return insert_data;
}).then(function (insert_data) {
return insert_data;
}).then(function (insert_data) {
// is deze chaining goed?
ActiveAuctionProfile.increaseProfileTime(item.id).then(function (res) {
resolve(res);
}).catch(function (reason) {
reject(reason);
})
}).catch(function (reason) {
reject(reason);
});
@yasinkocak
Copy link

Ook de gewrapte function moeten waarde return anders blijft die wachten

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment