angular - How to throttle updates from ngRedux store to component -


we use ngredux handle store in angular2 application.

application queries rest service multiple times compose data graph. each time rest result arrives store updated adding result existing data.

the graph component re-renders each time data changes. works small datasets , application seems snappy, large datasets becomes slow , of time spent re-rendering graph (ngx-charts-area-chart year of datapoints).

i debounce data store -> graph somehow.

i have tried several methods:

  • debounce inside pipe this: [data]="data$ | mydebouncepipe | async"
  • change store reference from:

    @select((x: iappstate) => x.path.to.data) data$: observable<imultitimeseries[]>; 

    to:

    data$: observable<imultitimeseries[]>;  constructor(private ngredux: ngredux<iappstate>) {    this.data$ = ngredux.select((x: iappstate) => x.path.to.data).debouncetime(5000); } 
  • copy entire code angulars async pipe application add debouncetime inside subscriptionstrategi.

all above attempts fail same error deep inside zone.js:

cannot read property 'length' of null

can spot doing wrong?


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -