How to use the worker-timers.clearTimeout function in worker-timers

To help you get started, we’ve selected a few worker-timers 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 Nike-Inc / cerberus / dashboard / app / actions / authenticationActions.js View on Github external
return function(dispatch, getState) {
        let sessionWarningTimeoutId = getState().auth.sessionWarningTimeoutId
        log.debug(`Removing warning timeout, id: ${sessionWarningTimeoutId}`)
        try {
            workerTimers.clearTimeout(getState().auth.sessionWarningTimeoutId)
        } catch(err) {
            console.log(`Failed to clear session warning timeout, id=${sessionWarningTimeoutId}`)
            console.log(err)
        }
        dispatch(removeSessionWarningTimeoutId())
    }
}

worker-timers

A replacement for setInterval() and setTimeout() which works in unfocused windows.

MIT
Latest version published 2 months ago

Package Health Score

73 / 100
Full package analysis