import { useEffect as o } from "react";
import { VisualElementDragControls as u } from "./VisualElementDragControls.es.js";
import { useConstant as s } from "../../utils/use-constant.es.js";
function f(t) {
  var n = t.dragControls, e = t.visualElement, r = s(function() {
    return new u(e);
  });
  o(function() {
    return n && n.subscribe(r);
  }, [r, n]), o(function() {
    return r.addListeners();
  }, [r]);
}
export {
  f as useDrag
};
//# sourceMappingURL=use-drag.es.js.map
