Skip to content

Instantly share code, notes, and snippets.

@odoe
Created April 19, 2019 14:26
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 odoe/66ff8725cbf8a534fa77ad7fb5c48910 to your computer and use it in GitHub Desktop.
Save odoe/66ff8725cbf8a534fa77ad7fb5c48910 to your computer and use it in GitHub Desktop.
const fetchResult = commandFactory<Item>(async ({ path, payload }) => {
const response = await fetch(payload.value);
const result = await response.json();
return [replace(path("result"), JSON.stringify(result, undefined, 2))];
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment