https://github.com/xyzdata/redux-simple-tutorial
//
const promise = new Promise( | |
(resolve, reject) => { | |
// do a thing, possibly async, then… | |
if (/* everything turned out fine */) { | |
resolve("Stuff worked!"); | |
} | |
else { | |
reject(Error("It broke")); | |
} | |
} |
const promise = new Promise( | |
(resolve, reject) => { | |
// do a thing, possibly async, then… | |
if (/* everything turned out fine */) { | |
resolve("Stuff worked!"); | |
} | |
else { | |
reject(Error("It broke")); | |
} | |
} |
<h1>Flutter in DartPad live app</h1> | |
<div> | |
<canvas id="canvas" width="300" height="300"></canvas> | |
</div> | |