UNPKG

@trellixio/roaster-coffee

Version:
17 lines (14 loc) 380 B
import * as React from 'react'; import { guid } from '../guid/index.js'; function useRoasterId() { const [uid, setUid] = React.useState(""); React.useEffect(() => { setUid(`roaster-${guid()}`); }, []); return uid; } function useUid(staticId) { return typeof staticId === "string" ? staticId : useRoasterId(); } export { useUid }; //# sourceMappingURL=index.js.map