persona-community-5/.pnpm-store/v3/files/21/e5c7443ba1946cf92c79d1dee75dfc0e027010d93b88868ff7b5280f200528ee9c28b931f8c40add0a5eed8ea04aa4e234310650a03669000a868f39a78330
rdev-worker a1d0d1bf1c
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
build: /implement-feature community-ui --requirements 'Build the React commu...
2026-02-24 08:22:30 +00:00

28 lines
846 B
Plaintext

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.styleHookSingleton = void 0;
var tslib_1 = require("tslib");
var React = tslib_1.__importStar(require("react"));
var singleton_1 = require("./singleton");
/**
* creates a hook to control style singleton
* @see {@link styleSingleton} for a safer component version
* @example
* ```tsx
* const useStyle = styleHookSingleton();
* ///
* useStyle('body { overflow: hidden}');
*/
var styleHookSingleton = function () {
var sheet = (0, singleton_1.stylesheetSingleton)();
return function (styles, isDynamic) {
React.useEffect(function () {
sheet.add(styles);
return function () {
sheet.remove();
};
}, [styles && isDynamic]);
};
};
exports.styleHookSingleton = styleHookSingleton;