import { useRef, useEffect } from 'react';
export function useHandler(props, factory) {
  var propsRef = useRef(props);
  var handlerRef = useRef(function () {
    var handler = factory(propsRef.current);
    return handler && handler.apply(void 0, arguments);
  });
  useEffect(function () {
    propsRef.current = props;
  });
  return handlerRef.current;
}
//# sourceMappingURL=useHandler.js.map