-
Notifications
You must be signed in to change notification settings - Fork 299
fix: increase default timeout and respect value passed to ky.extend
#1130
Conversation
Some of our operations take a really long time, if we don't set a timeout for `ky` we get the default of 10 seconds. This PR sets the timeout to `false` if one is not explicitly passed which disables it. Nb. I had to add the default to `false` to every invocation. Looking at the code it should be enough to do it in `src/lib/configure.js` but it doesn't seem to be.
Predictably it's because we pass |
df2a7e3
to
cc40ce5
Compare
I've changed the timeout to wait for something stupid but not to wait forever, and also added a Depends on schnittstabil/merge-options#14 |
ky.extend
0d42bf4
to
af66a0a
Compare
function wrap (fn, defaults) { | ||
return (input, options) => { | ||
return fn(input, mergeOptions(defaults, options)) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion:
const wrap = (fn, defaults) => (input, options) => fn(input, mergeOptions(defaults, options));
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find this sort of deeply chained single-line-arrow-function style optimises readability for computers and not humans. It'll get minified to something similar to this anyway so there's little to gain here.
…#1130) * fix: disable timeout if not set Some of our operations take a really long time, if we don't set a timeout for `ky` we get the default of 10 seconds. This PR sets the timeout to `false` if one is not explicitly passed which disables it. Nb. I had to add the default to `false` to every invocation. Looking at the code it should be enough to do it in `src/lib/configure.js` but it doesn't seem to be. * fix: use `ignoreUndefined` merge-options option * chore: update bundle size * chore: remove git url
Some of our operations take a really long time, if we don't set a timeout for
ky
we get the default of 10 seconds. This PR sets the timeout tofalse
if one is not explicitly passed which disables it.Nb. I had to add the default to
false
to every invocation. Looking at the code it should be enough to do it insrc/lib/configure.js
but it doesn't seem to be. Might be a bug inky
, I'll dig a little deeper.