Created
February 14, 2024 12:51
-
-
Save hexcowboy/d986da2d84feb9ff01806c1cfdc437b5 to your computer and use it in GitHub Desktop.
JS/TS `fetch` simple abstraction
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
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