Typeahead modifies Observable prototype
See original GitHub issueBug description:
The current code modifies the prototype of Observable in the typeahead component using statements like here:
import 'rxjs/add/observable/fromEvent';
This is bad for several reasons. The consuming application is not aware of what is imported where and under which conditions. Also it constitutes a side effect which is generally to be avoided. The right way to do it is to import the operator as a function and use it standalone (e.g. map.call(myObservable, ...)
), passing the Observable as an argument. An example can be found in the Angular code base:
https://github.com/angular/angular/blob/master/modules/%40angular/router/src/router.ts#L20
https://github.com/angular/angular/blob/master/modules/%40angular/router/src/router.ts#L685
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:11 (8 by maintainers)
Top Results From Across the Web
rxjs - Rewriting observable sequence to make more sense
I'm creating a typeahead that remotely calls an api every time someone types in the input, with a small delay after typing. This...
Read more >Version Pinning for Notebooks / Fabian Iwand / Observable
Observable supports version pinning by appending the version number to the notebook name or path. These functions make it easier to look up...
Read more >Typeahead - Observable Hooks
React hooks for RxJS Observables. Simple, flexible, testable and performant.
Read more >RxJS Autocomplete example - Unsaved project - Plunker
##RxJS Autocomplete example ###Example to show combining input events such as keyup ... Object.create(Error.prototype); ObjectDisposedError.prototype.name ...
Read more >Safari Technology Preview Release Notes - Apple Developer
Accelerated Array.prototype.slice on DirectArguments (256027@main) ... Changed CSS autocomplete so that the most commonly used property accounts for ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
it’s not true https://github.com/ng-bootstrap/ng-bootstrap/search?utf8=✓&q=rxjs%2Fadd%2Fobservable
@blesh thx 😃