rxjs-zone-less
Version:
A set of wrappers for RxJS to avoid unnecessary change detection and zone interference in Angular.
17 lines (16 loc) • 760 B
JavaScript
import { setInterval, clearInterval } from './zone-less';
export const intervalProvider = {
// When accessing the delegate, use the variable rather than `this` so that
// the functions can be called without being bound to the provider.
setInterval(handler, timeout, ...args) {
const { delegate } = intervalProvider;
if (delegate === null || delegate === void 0 ? void 0 : delegate.setInterval) {
return delegate.setInterval(handler, timeout, ...args);
}
return setInterval(handler, timeout);
},
clearInterval(handle) {
const { delegate } = intervalProvider;
return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearInterval) || clearInterval)(handle);
},
};