What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-09-20 16:12:02
promise all in promise all
var p1 = Promise.resolve(3); var p2 = 1337; var p3 = new Promise((resolve, reject) => { setTimeout(resolve, 100, "foo"); }); Promise.all([p1, p2, p3]).then(values => { console.log(values); // [3, 1337, "foo"] }); Add solution -
Javascript 2021-09-17 23:50:04
gatsby creating pages from contentful
const path = require('path') exports.createPages = ({graphql, boundActionCreators}) => { const {createPage} = boundActionCreators return new Promise((resolve, reject) => { const storeTemplate = path.resolve('src/templates/store.js') res... Add solution -
Other 2021-09-17 00:44:04
koa-router 404 not found
async getMessages(ctx) { const id = ctx.params.id const nameOfConversation = await ctx.db.Conversation.findById(id) ctx.body = await new Promise((resolve, reject) => { firebaseIndex.fbController.getConversation(nameOfConversation.... Add solution -
Javascript 2021-09-06 19:38:04
promise.allsettled polyfill node
Promise.myAll = function (promises) { var count = promises.length var result = new Array(count).fill(false) return new Promise((resolve, reject) => { var checkIfDone = () => { if (--count === 0) resolve(result) } promises.f... Add solution