- Updated all component headers and documentation
- Changed navbar and footer branding
- Updated homepage hero badge
- Modified page title in index.html
- Simplified footer text to 'Built with ❤️'
- Consistent V2 capitalization across all references
24 lines
533 B
JavaScript
24 lines
533 B
JavaScript
'use client';
|
|
'use strict';
|
|
|
|
var react = require('react');
|
|
var useCallbackRef = require('./use-callback-ref.cjs');
|
|
|
|
function useInterval(callback, delay) {
|
|
const fn = useCallbackRef.useCallbackRef(callback);
|
|
react.useEffect(() => {
|
|
let intervalId = null;
|
|
const tick = () => fn();
|
|
if (delay !== null) {
|
|
intervalId = window.setInterval(tick, delay);
|
|
}
|
|
return () => {
|
|
if (intervalId) {
|
|
window.clearInterval(intervalId);
|
|
}
|
|
};
|
|
}, [delay, fn]);
|
|
}
|
|
|
|
exports.useInterval = useInterval;
|