Scripts
- promise.js –
@version 3.2.2+39aa2571stefanpenner/es6-promise - script.js
getJSON('story.json') // url -> story.json
.then(loadChapters) // story.chapters -> Promise.all([url] -> [chapter.json]) promise array
.then(loopChapters) // chapters.forEach -> print
.catch(errore)
.then(allDone);
- Reusable
getJSON, promised-all tochapters - Just a
forEachloop
Json files