Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Non-Blocking Asynchronous JSON.parse Using the Fetch API.
function asyncParse(string) { return new Promise(function(res, rej) { resolve(JSON.parse(string)); }); }
- or -
let asyncParse = async (string) => JSON.parse(string);
function asyncParse(string) { return new Promise(function(res, rej) { resolve(JSON.parse(string)); }); }
- or -
let asyncParse = async (string) => JSON.parse(string);