useIntervalWhen
Aboutβ
Sets an interval immediately when a condition is true
Installationβ
npm install --save rooks
Importing the hookβ
import { useIntervalWhen } from 'rooks';
Usageβ
function Demo() {
useIntervalWhen(() => {
console.log('runs every 2 seconds');
}, 2000);
return null;
}
render(<Demo />);
Codesandbox Examplesβ
Basic Usageβ
Join Bhargav's discord serverβ
You can click on the floating discord icon at the bottom right of the screen and talk to us in our server.