"use strict";
/* eslint-disable */
exports.__esModule = true;
exports.useFlag = void 0;
var tslib_1 = require("tslib");
var react_1 = require("react");
var not = function (state) { return !state; };
var useFlag = function (initial) {
    if (initial === void 0) { initial = false; }
    var _a = (0, tslib_1.__read)((0, react_1.useState)(initial), 2), state = _a[0], setState = _a[1];
    var on = (0, react_1.useCallback)(function () { return setState(true); }, []);
    var off = (0, react_1.useCallback)(function () { return setState(false); }, []);
    var toogle = (0, react_1.useCallback)(function () { return setState(not); }, []);
    return [
        state,
        {
            on: on,
            off: off,
            toogle: toogle
        },
    ];
};
exports.useFlag = useFlag;
