Scripts
- promise.js –
@version 3.2.2+39aa2571
stefanpenner/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
forEach
loop
Json files