Skip to content

Instantly share code, notes, and snippets.

@FagnerMartinsBrack
Last active July 15, 2018 00:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FagnerMartinsBrack/9ab6afe3de083648a1b7e8bfa301721c to your computer and use it in GitHub Desktop.
Save FagnerMartinsBrack/9ab6afe3de083648a1b7e8bfa301721c to your computer and use it in GitHub Desktop.
(Medium) - Decouple Side-Effects
const createListOfPosts_ = () => {
const PostsResponse = /* import */ PostsResponse_;
return fetch(
+ '/blog/articles'
- '/blog/posts'
).then((response) => {
return response.text();
}).then((htmlResponse) => {
return PostsResponse(htmlResponse).toHtmlList();
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment