How to use the redux-bundler.debounce function in redux-bundler

To help you get started, we’ve selected a few redux-bundler examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ipfs-shipyard / ipfs-webui / src / bundles / app-idle.js View on Github external
export const getIdleDispatcher = (stopWhenInactive, timeout, fn) =>
  debounce(() => {
    // the requestAnimationFrame ensures it doesn't run when tab isn't active
    stopWhenInactive ? raf(() => ric(fn, ricOptions)) : ric(fn, ricOptions)
  }, timeout)
github HenrikJoreteg / redux-bundler-worker-example / src / bundles / viewport.js View on Github external
init: store => {
    const callback = debounce(store.doTrackWindowResize, 200)
    workerProof((cb, debounce) => {
      cb({
        height: window.innerHeight,
        width: window.innerWidth
      })
      window.addEventListener('resize', () => {
        cb({
          height: window.innerHeight,
          width: window.innerWidth
        })
      }, {passive: true})
    }, callback)
  }
}