Feature request: Implement Promise interface.
svenvandescheur opened this issue · 3 comments
It would be very useful to have animateScrollTo()
return a Promise
object. This would help a lot in environments where scrolling is part of a bigger animation path.
animateScrollTo(node, { offset: -100 })
.then(node => console.log('scrolled to', node))
Hello @svenvandescheur,
That is interesting suggestion. Currently there is onComplete
param which allows you a callback which will be called when scrolling is complete. I want to rewrite this library, but always something else pops up. I'll have this in mind though!
Cheers!
@Stanko I won't be able to look into it anytime soon but I might in a month or so. I think the biggest issue here is dealing with legacy environments that don't support Promises. My guess is that the actual implementation shouldn't be that difficult.
Released in 2.0.0-beta.0