Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
(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