feat(Symbol.observable): is no longer polyfilled#3387
feat(Symbol.observable): is no longer polyfilled#3387benlesh merged 1 commit intoReactiveX:masterfrom
Conversation
Generated by 🚫 dangerJS |
a725e97 to
dc575ba
Compare
dc575ba to
21c54e1
Compare
src/internal/symbol/observable.ts
Outdated
| really *required*, however, they should be warned to give them a | ||
| clue as to why they might be seeing errors when trying to convert | ||
| ObservableLikes to Observables */ | ||
| if (!Symbol || !Symbol.observable) { |
There was a problem hiding this comment.
This will need to do typeof Symbol because otherwise it still will do Symbol is not defined. See #3394 for reference example
src/internal/symbol/observable.ts
Outdated
| * @deprecated use {@link observable} | ||
| */ | ||
| export const $$observable = observable; | ||
| export const $$observable = Symbol && Symbol.observable || '@@observable'; |
There was a problem hiding this comment.
Same as above, prolly easiest to wrap in a function like done in #3394 so only need to check once. Also will allow you to easily make sure the type is of symbol instead of any as it is in this case.
There was a problem hiding this comment.
Wrapping it in a function will only make it easier to test. The module body itself should only be called once, no?
There was a problem hiding this comment.
@benlesh Partially, though it also makes it easier to only need to do the typeof Symbol check once.
|
btw I think these symbols are no longer publicly exported except for in the UMD build. Which one is intended? I'm not entirely sure if we should be exporting any of them. If we did, seems like I can see a possible argument about allowing libraries that use RxJS to add support for |
|
I don't disagree, @jayphelps, I think we should only be implementing/executing some logic if Symbol.observable is defined... this was just the quickest incremental step. |
BREAKING CHANGE: RxJS will no longer be polyfilling Symbol.observable. That should be done by an actual polyfill library. This is to prevent duplication of code, and also to prevent having modules with side-effects in rxjs.
21c54e1 to
433d774
Compare
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
BREAKING CHANGE: RxJS will no longer be polyfilling Symbol.observable. That should be done by an actual polyfill library. This is to prevent duplication of code, and also to prevent having modules with side-effects in rxjs.