Last active
April 29, 2021 03:50
-
-
Save ideal-knee/82be340b44829e6efa0a2437d60401fb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const makeSingleIO = () => { | |
let put, err; | |
const promise = new Promise((resolve, reject) => { | |
put = resolve; | |
err = reject; | |
}); | |
return { put, err, get: () => promise }; | |
}; | |
const testSingleIO = async () => { | |
const testIO = makeSingleIO(); | |
testIO.put("flub"); | |
const result = await testIO.get(); | |
console.log(result); | |
}; | |
testSingleIO(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment