UNPKG

@engie-group/fluid-design-system-react

Version:

Fluid Design System React

16 lines (14 loc) 434 B
const mapData = ((): { get: (instance: string) => string } => { const storeData: Record<string, string> = {}; return { get(instance): string { if (typeof storeData[instance] === 'undefined') { storeData[instance] = '_' + Math.random().toString(36).substring(2, 11); } return storeData[instance]; } }; })(); export const GenID = function (instance: string) { return mapData.get(instance); };