-
-
Notifications
You must be signed in to change notification settings - Fork 376
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add option for custom
fetch
implementation (#273)
* Overwrite globals.fetch when a 'fetch' option was provided * Fixed bug that wouldn't let me overwrite globals' properties * Fixed bug where 'this' referenced to the wrong object * Added basic documentation * Overwriting globals.fetch affects all other ky calls, therefore switched to this._options.fetch * Added basic tests * Formatting * More Formatting * Update index.d.ts * Update readme.md * Use shorthand syntax for passing fetch function in examples * Added more assertions to the test and removed .serial() * Added note that the user-defined fetch function has to be compatible with the standard * Fixed test * Plan for 12 assertions because every call for fetch is another assertion * Remove trailing comma * Remove configurable setting as it's not needed anymore Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com> Co-authored-by: Seth Holladay <me@seth-holladay.com>
- Loading branch information
1 parent
6e02940
commit ccda3b9
Showing
4 changed files
with
70 additions
and
6 deletions.
There are no files selected for viewing
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
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
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
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