@ljcl/storybook-addon-cssprops
Version:
Interact with css custom properties dynamically in the Storybook UI
12 lines (11 loc) • 439 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.useWindowEvent = void 0;
var react_1 = require("react");
function useWindowEvent(type, listener, options) {
(0, react_1.useEffect)(function () {
window.addEventListener(type, listener, options);
return function () { return window.removeEventListener(type, listener, options); };
}, []);
}
exports.useWindowEvent = useWindowEvent;