Skip to content

Instantly share code, notes, and snippets.

@JeremyLikness
Created October 22, 2019 15:14
Show Gist options
  • Select an option

  • Save JeremyLikness/d92d81d598c8c69eb31d8a2c3107755f to your computer and use it in GitHub Desktop.

Select an option

Save JeremyLikness/d92d81d598c8c69eb31d8a2c3107755f to your computer and use it in GitHub Desktop.
Vanilla.js fetch example
const get = (model, domain, done) => {
fetch(`https://jsonplaceholder.typicode.com/${domain}`)
.then(response => response.json())
.then(json => {
model[domain] = json;
done();
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment