import { useCallback, useRef } from 'react';

var useStaticCallback = function useStaticCallback(callback) {
  var ref = useRef();
  ref.current = callback;
  var action = useCallback(function () {
    var args = [];

    for (var _i = 0; _i < arguments.length; _i++) {
      args[_i] = arguments[_i];
    }

    ref.current && ref.current.apply(ref, args);
  }, []);
  return action;
};

export default useStaticCallback;

