import { useRef } from 'react';
import { isNil } from 'ramda';
var lastId = 0;

var getLastId = function getLastId() {
  return String(lastId++);
};

var useGeneratedId = function useGeneratedId() {
  var uniqueID = useRef(null);

  if (isNil(uniqueID.current)) {
    uniqueID.current = getLastId();
  }

  return uniqueID.current;
};

export default useGeneratedId;