You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We want to restructure the exports of Ky to only use export default and no named exports. This involves attaching HTTPError and TimeoutError to the Ky instance and removing the existing export statements for them.
The reasoning behind this:
ky.TimeoutError is clearer than just TimeoutError
The current situation of mixing default and named exports hurts the ergonomics for CommonJS users since they have to use ky.default
The alternative is to only use named exports, but then what would we name the current default export? import { ky } from 'ky' would be a bit strange and import * as ky would then involve using ky.ky, which almost seems worse than ky.default. We should just stick to using either named exports or the default export. In Ky's case, default export seems to make the most sense.
We want to restructure the exports of Ky to only use
export default
and no named exports. This involves attachingHTTPError
andTimeoutError
to the Ky instance and removing the existing export statements for them.The reasoning behind this:
ky.TimeoutError
is clearer than justTimeoutError
ky.default
import { ky } from 'ky'
would be a bit strange andimport * as ky
would then involve usingky.ky
, which almost seems worse thanky.default
. We should just stick to using either named exports or the default export. In Ky's case, default export seems to make the most sense.See discussion in #198 (comment)
The text was updated successfully, but these errors were encountered: