Published
Edited
Jan 7, 2019
1 star
Insert cell
Insert cell
Promise.all([1, 2, Promise.resolve(3), new Promise(r => r(4))])
Insert cell
Insert cell
{
let x = new Promise((resolve, reject) => {
setTimeout(reject, 100);
});
let caught = x.catch(rejected => {
return `I'm okay, I'll get over it`;
});
return caught;
}
Insert cell
Insert cell
promiseValue = {
let val = new Promise((resolve, reject) => {
setTimeout(() => resolve(10), 100);
});
return () => val;
}
Insert cell
{
return promiseValue().then(p => {
return p + 2;
});
}
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more