import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
import LocalStorageDatasetManager from "udt-dataset-managers/dist/LocalStorageDatasetManager";
import useActiveDatasetManager from "../use-active-dataset-manager";
import useEventCallback from "use-event-callback";
export default (function () {
  var _useActiveDatasetMana = useActiveDatasetManager(),
      _useActiveDatasetMana2 = _slicedToArray(_useActiveDatasetMana, 2),
      setActiveDatasetManager = _useActiveDatasetMana2[1];

  return useEventCallback(function (template) {
    var dm = new LocalStorageDatasetManager();
    dm.setDataset(template.dataset);
    setActiveDatasetManager(dm);
  });
});