Closed jonathanong closed 8 years ago
I considered this in #1, but ended up just adding a note in the README about removing installations not at the top level if registering a preferred implementation (using npm dedupe
or manually if npm3 doesn't take care of it for you).
I'm thinking it would only be required if registering a preferred implementation since it defaults to global.Promise
, but I may be wrong. Is there a reason to do it all the time?
I was hesitant to add a global variable, but it's probably not a big deal if I use something unlikely to conflict, e.g. global['@@ANY_PROMISE_REGISTRATION']
.
+1 for global['@@ANY_PROMISE_REGISTRATION']
I am about to add any-promise
to request-promise
and I would now need to add the npm dedupe
instructions to request-promise's README as well. IMHO this makes it too complicated for the library users. To be fair running npm dedupe
once in your dev environment is one more thing to take care of but doable. But how about the CI systems and the production deployment? Still doable but already pretty involved I would say...
Published 1.1.0 with global registration to prevent duplicate implementations.
Thanks!
Awesome, thanks you @kevinbeaty !
i.e. attach stuff to
global
and return the same instance ofany-promise
if for some reason there are multiple copies of it.