The following ngrx select is deprecated.
this.store.select(state => state.academy.academy).subscribe((academy) => {
this.academy = academy;
});
I found this at store.d.ts
@deprecated from 6.1.0. Use the pipeable `select` operator instead.
So... what's the correct syntax?
I try
this.store.pipe(select(state => state.academy.academy).subscribe((academy) => {
this.academy = academy;
}))
Error: Cannot find name 'select'. Did you mean 'onselect'?
As @Michalis mentioned, just get
select
from@ngrx/store
.This feature was added in v5.0.0, and since then
this.store.select()
has been deprecated. However, notice for the same is added in release v6.1.0. AsStore<T>
itself extendsObservable<T>
, it returns observable which can easily be subscribed using.subscribe()
or can be manipulated/transformed using different patch operators.RxJS introduced pipable operators and
.pipe()
in v5.5. There is also a pipe utility function that can be used to build reusable pipeable operators. In release v5, with the help ofpipe()
customselect
operator is built. Check out this link or basic example(ignore empty state) is given beneath, to learn more.As per NgRx 7, the
select
method is un-deprecated.For more info, see the associated Pull Request.