简体   繁体   中英

Infinite Error when use async pipe and #select decorator in redux angular 9

I code simple example for using redux in angular 9. the code is working good when i write.

 count: number=0;
 constructor(
   private ngRedux: NgRedux<IAppState>, 
   private actions: CounterActions  ) 
      {
         var subscription=ngRedux.subscribe(()=>{
         var store =ngRedux.getState();
         this.count =store.count
      });
     }

and in html

  Count: {{ count}}

But when the error occures in the next section. at ts.

@select() count ;

and at html

      Count: {{ count |async}}

it release infinit error

无限错误

in your code count is not an observable. that's why you are getting this error. check type of count after you get it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM