I am trying to throttle ngrx store action updates events with the following code
import 'rxjs/add/operator/throttle'
import { Dispatcher, Store } from '@ngrx/store';
...
static get parameters() {
return [[Dispatcher]];
}
constructor(actions$) {
...
this.actions$
.filter(action => action.type === this.Actions[`LOAD_USERS_REQUEST`])
.throttle(1000 /* ms */)
.subscribe(() =>
...
);
this throws me an error
at ThrottleSubscriber.tryDurationSelector (throttle.js:80) TypeError: this.durationSelector is not a function
When I replace .throttle(1000) with .throttle(() => 1000) it throws a different error that clearly shows throttle expects a function, just not the one that I provide. But I wonder why because the documentation states throttle expects a number value.
https://github.com/Reactive-Extensions/RxJS/blob/master/doc/api/core/operators/throttle.md
import 'rxjs/add/operator/throttle'- Fabio Antunes