let button = document.querySelector('.mbtn');
let lab = document.querySelector('.mlab');
let clickStream = Observable.fromEvent(button,'click');
let doubleClickStream = clickStream
.buffer(()=> clickStream.throttle(250))
.map(arr => arr.length)
.filter(len => len === 2);
doubleClickStream.subscribe(event =>{
lab.textContent = 'double click';
});
doubleClickStream.throttle(1000)
.subscribe(suggestion =>{
lab.textContent = '-';
});
Unfortunately, I encountered an error in my Angular2 project that is challenging to resolve. Can anyone offer assistance? The error log is shown below:
ERROR in /Users/genilex3/Desktop/meager/angularRxjs/angularrxjs/src/app/app.component.ts (58,15): Argument of type '() => any' is not assignable to parameter of type 'Observable'. Property '_isScalar' is missing in type '() => any'.
ERROR in /Users/genilex3/Desktop/meager/angularRxjs/angularrxjs/src/app/app.component.ts (58,41): Argument of type 'number' is not assignable to parameter of type '(value: {}) => SubscribableOrPromise'.