Skip to content

Instantly share code, notes, and snippets.

@greim
Last active November 11, 2017 00:11
Show Gist options
  • Save greim/eaf25976a307e265cb6f226721515569 to your computer and use it in GitHub Desktop.
Save greim/eaf25976a307e265cb6f226721515569 to your computer and use it in GitHub Desktop.
Data Vacancies
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