/* eslint-disable */
import { __read } from "tslib";
import { useCallback, useState } from 'react';
var not = function (state) { return !state; };
export var useFlag = function (initial) {
    if (initial === void 0) { initial = false; }
    var _a = __read(useState(initial), 2), state = _a[0], setState = _a[1];
    var on = useCallback(function () { return setState(true); }, []);
    var off = useCallback(function () { return setState(false); }, []);
    var toogle = useCallback(function () { return setState(not); }, []);
    return [
        state,
        {
            on: on,
            off: off,
            toogle: toogle
        },
    ];
};
