Last active
September 21, 2017 16:55
-
-
Save rbren/b1ce2b9b3ef1767e7629f082c31d3ef8 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
function readFilePromise(filename) { | |
if (!filename) { | |
return Promise.reject(new Error("Filename not specified")); | |
} | |
if (filename === 'index.html') { | |
return Promise.resolve('<h1>Hello!</h1>'); | |
} | |
return new Promise((resolve, reject) => {/*...*/}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment