Closed gerarts closed 1 year ago
This fixes #122
I have applied your suggestion. 👍
I think a lot of libs just copied the Symbol.observable
polyfill implementation from either the proposal or RxJS, and it sort of spread through the 'copy-paste approach'.
It might be nice to add something to the docs / readme to explain how developers can manually polyfill Symbol.observable
if they are running into trouble with other libs that do the same thing as wonka
's current implementation.
Another alternative would be adding the old polyfill as a separate module to allow developers to import the legacy polyfill (something like import 'wonka/legacy-symbol-observable-polyfill'
). This would also allow you to add a deprecation console.warn
in the future.
Let me know if you'd like me to get on either of those.
re. the docs, they're not in a state yet where they can be edited again, but that's on my to-do list, but I'm hoping this will do for now
Prettier was unhappy, should be good now
Resolves #122
Resolve #122
One of the issues users may run into in the current situation is that if Wonka is loaded after other Observable objects have already been created with the ponyfill method, Wonka will polyfill the
Symbol.observable
causing packages to no longer recognise previously created observables, breaking interoperability.This PR makes sure Wonka's behaviour matches that of other packages like RxJS src/internal/symbol/observable.ts and redux src/utils/symbol-observable.ts.