domtools / Prometto

Promise request and print a json book

Scripts

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);
  1. Reusable getJSON, promised-all to chapters
  2. Just a forEach loop

Json files