"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = useSelectionUpdate;
var _react = require("react");
var _eventBus = _interopRequireDefault(require("../utils/event-bus"));
function useSelectionUpdate() {
  const [, update] = (0, _react.useState)({});
  (0, _react.useEffect)(() => {
    const onChange = () => update({});
    const eventBus = _eventBus.default.getInstance();
    const unsubscribe = eventBus.subscribe('change', onChange);
    return () => {
      unsubscribe();
    };
  }, []);
}