Skip to content

Commit

Permalink
console log demo
Browse files Browse the repository at this point in the history
  • Loading branch information
theopak committed Apr 22, 2021
1 parent 646d596 commit 37a69f5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/plugin-hooks/useResizeColumns.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,24 @@ const defaultGetResizerProps = (props, { instance, header }) => {
let raf
let mostRecentClientX

let counterA = 0
let counterB = 0
const dispatchEnd = () => {
window.cancelAnimationFrame(raf)
raf = null
dispatch({ type: actions.columnDoneResizing })
}
const dispatchMove = () => {
counterB++
console.log(counterA, counterB)
window.cancelAnimationFrame(raf)
raf = null
dispatch({ type: actions.columnResizing, clientX: mostRecentClientX })
}

const scheduleDispatchMoveOnNextAnimationFrame = clientXPos => {
mostRecentClientX = clientXPos
counterA++
if (!raf) {
raf = window.requestAnimationFrame(dispatchMove)
}
Expand Down

0 comments on commit 37a69f5

Please sign in to comment.