"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});

var react_1 = require("react");

var useStaticCallback = function useStaticCallback(callback) {
  var ref = react_1.useRef();
  ref.current = callback;
  var action = react_1.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;
};

exports["default"] = useStaticCallback;

