text: "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  var tslib_1 = require("tslib");
  var hooks_1 = require("preact/hooks");
  var useUpdate_1 = tslib_1.__importDefault(require("./useUpdate"));
  var hookState_1 = require("./misc/hookState");
  function useGetSet(initialState) {
      var state = hooks_1.useRef(hookState_1.resolveHookState(initialState));
      var update = useUpdate_1.default();
      return hooks_1.useMemo(function () { return [
          function () { return state.current; },
          function (newState) {
              state.current = hookState_1.resolveHookState(newState, state.current);
              update();
          },
      ]; }, []);
  }
  exports.default = useGetSet;
  