import { useRef, useCallback } from 'react';

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

export { useDataValue as u };
