I recently updated my version of angular using ng update
and when running ng lint
I am getting the error create is deprecated: use new Observable() instead
this.data$ = Observable.create(t => { t.next(this.model); t.complete(); });
What is the syntax for new observable?
Angular: create is deprecated: use new Observable() instead. New!
Observables are "lazy", meaning if no one is listening, nothing happens.
Angular makes use of observables as an interface to handle a variety of common asynchronous operations. For example: The HTTP module uses observables to handle AJAX requests and responses. The Router and Forms modules use observables to listen for and respond to user-input events.
Pretty simple
this.data$ = new Observable((observer: Observer) => { observer.next(); observer.complete(); });
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With