import { useState } from "react";
function useCallbackRef(initialValue, callback) {
  var ref = useState(function() {
    return {
      value: initialValue,
      callback,
      facade: {
        get current() {
          return ref.value;
        },
        set current(value) {
          var last = ref.value;
          if (last !== value) {
            ref.value = value;
            ref.callback(value, last);
          }
        }
      }
    };
  })[0];
  ref.callback = callback;
  return ref.facade;
}
export {
  useCallbackRef
};
//# sourceMappingURL=useRef.js.map
