My goal is to call a function for a slideshow which changes the slide to the next or the previous one. It's that simple
if (location.pathname === "/") {
var backgroundElement = document.querySelector('.carousel');
hammer = new Hammer(backgroundElement)
hammer.on('panright panleft', function (event) {
var stream = rxjs.fromEvent(backgroundElement, 'deltaX');
stream.pipe(
rxjs.map((i) => console.log(i)),
rxjs.debounceTime(1000)
)
.subscribe(j => {
console.log(j);
if (j.deltaX > 250) { carousel.next(); }
else if (j.deltaX < -250) { carousel.previous(); }
});
})
}
None appear apparently. Adding error => console.log(error); to the subscription appears to do nothing as well. Nothing is console logged either... I at least want to get a console log...