Skip to content

Instantly share code, notes, and snippets.

@hexcowboy
Created February 14, 2024 12:51
Show Gist options
  • Save hexcowboy/d986da2d84feb9ff01806c1cfdc437b5 to your computer and use it in GitHub Desktop.
Save hexcowboy/d986da2d84feb9ff01806c1cfdc437b5 to your computer and use it in GitHub Desktop.
JS/TS `fetch` simple abstraction
const request = (fetch => {
return (...args) => fetch(...args).then(res => res.json());
})(fetch);
await request(url);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment