"use strict";

exports.__esModule = true;
exports.useSelector = useSelector;
var _mobx = require("mobx");
var _react = require("react");
// https://github.com/mobxjs/mobx/discussions/2566#discussioncomment-593670
function useSelector(select) {
  const [selected, setSelected] = (0, _react.useState)(() => (0, _mobx.runInAction)(select));
  (0, _react.useEffect)(() => (0, _mobx.autorun)(() => setSelected(select())), []);
  return selected;
}
//# sourceMappingURL=useSelector.js.map