Files
NapCatQQ/.pnpm-store/v3/files/77/f75c189a64f0b6d22ee1c390d90050cec4f4d4b689a18c932f2365fd693fb4349d5ac9fd935e5d1b87c15f28c7a8f1ceea9f08a0c32e4223b682cc44d9857b
TanTan e311ca3275
Build NapCat Artifacts / Windows Loader Test (push) Canceled after 0s
Build NapCat Artifacts / Type Check & Test (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Framework (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Shell (push) Canceled after 0s
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

19 lines
694 B
Plaintext

import { __read } from "tslib";
import { useMemo } from 'react';
import useToggle from '../useToggle';
export default function useBoolean(defaultValue) {
if (defaultValue === void 0) { defaultValue = false; }
var _a = __read(useToggle(!!defaultValue), 2), state = _a[0], _b = _a[1], toggle = _b.toggle, set = _b.set;
var actions = useMemo(function () {
var setTrue = function () { return set(true); };
var setFalse = function () { return set(false); };
return {
toggle: toggle,
set: function (v) { return set(!!v); },
setTrue: setTrue,
setFalse: setFalse,
};
}, []);
return [state, actions];
}