"use strict";

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

var react_1 = require("react");

var useDataValue = function useDataValue(callback) {
  var ref = react_1.useRef();
  ref.current = callback;
  var action = react_1.useCallback(function (e) {
    var value = e.currentTarget.getAttribute('data-value');
    ref.current && ref.current(value, e);
  }, []);
  return action;
};

exports["default"] = useDataValue;

