-
-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mimic-fn dependency prevents use in some host environments #25
Comments
Sorry, I'm not interested in changing any code because of IE. I would recommend finding a different module :) |
@sindresorhus Since it's not just IE11 that is affected, what about just wrapping the call to I.e. change this: https://github.com/sindresorhus/mem/blob/bdfc93ad856fdf5622fc6406f601c9762370bc8a/index.js#L69 to this: try {
// the call to mimicFn below will throw in some host environments
// see https://github.com/sindresorhus/mimic-fn/issues/10
mimicFn(memoized, fn);
} catch (error) {} I would happily make the PR if you would accept that change (Sorry to pester btw, and thanks for all your work) |
Alright. I'm ok with a try/catch. |
After transpiling this dependency and all of it's dependencies (#23), this package still won't work on IE11 and other host environments (e.g. React Native on iOS) due to issue sindresorhus/mimic-function#10 which I would re-title "Error in host environments where Function instances have non-configurable properties".
My recommended solution is to remove the dependency on
mimic-fn
and make a new semver-major release, because:mimic-fn
does is not needed to memoize functions, which seems to be the "one thing" this package is meant to do; the purpose of each is orthogonalmimic-fn
provides, it is possible for them to applymimic-fn
to the function returned frommem
, without breaking any functionality of either package. The only downside for them is that they need to apply it themselves, but that seems appropriate, given the first point.The text was updated successfully, but these errors were encountered: