Last active
November 11, 2017 00:11
-
-
Save greim/eaf25976a307e265cb6f226721515569 to your computer and use it in GitHub Desktop.
Data Vacancies
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vacancies.listen('relatedProducts/:productId', async function(params, send) { | |
const id = params.productId; | |
const resp = await fetch(`/products/${id}/related`); | |
const products = await resp.json(); | |
send({ type: 'RECEIVE_RELATED_PRODUCTS', id, products }); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment