-
Notifications
You must be signed in to change notification settings - Fork 3k
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
old-way rxjs operators and factory methods vs lettable ones #3222
Comments
I guess operators can be imported the old way ( I think this approach (being forced to import factory methods in every file) less error-prone because before for example you could import static method in a lazy module and it still would be ok with ts compiler to use it anywhere across your app, but would cause an error at runtime |
leaving possibility to import operators in an old way while having new-way lettable operators saves lots of nerves to developers who use rxjs. Why backward compatible support of some factory methods (timer, interval...) was removed while some other are still supported (of...) -- that's a mystery and a huge headache. |
They're all still there in 5.5. Technically, I would advise against using any of the |
I think this can be closed. It was a misunderstanding. |
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. |
I posted this question here but didn't get an answer. I think this question relates to the library documentation improvements so I put it here too.
I bumped into the problem with lettable operators, in particular, with timer.
For instance, this:
import 'rxjs/add/operator/catch'
-- still works and even changes Observable object globally so there's no need to import that '
catch
' again in a certain ts file once it is imported in project module file.And this:
import 'rxjs/add/observable/timer'
-- doesn't work anymore, instead:
import { timer } 'rxjs/observable/timer'
-- should be used and it doesn't modify Observable object, it is used as an independent function, and it cannot be imported globally, it should be imported in each ts file individually if it is needed.
Why is
import 'rxjs/add/operator/catch'
still in use and has its counterpart of
import {catchError} from 'rxjs/operators/catchError'
and
import 'rxjs/add/observable/timer'
is no longer in use?
Is there any documentation on the topic? On the import syntax migration?
Thank you.
The text was updated successfully, but these errors were encountered: