Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
function getData(callback) {
setTimeout(() => callback("hi"), 10);
function render(promiseData) {
promiseData.then(data => console.log("data"));
// wrapper around getData() to make it return a promise
function getDataPromise() {
return new Promise((resolve, reject) => {
// use render with the wrapper
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment