UNPKG

one

Version:

One is a new React Framework that makes Vite serve both native and web.

12 lines (11 loc) 214 B
const w = new WeakMap<any, string>() export const weakKey = (item: any): string => { return ( w.get(item) ?? (() => { const k = `${Math.random()}` w.set(item, k) return k })() ) }