Better multi-window updates

This commit is contained in:
Gregory Schier
2023-03-29 21:53:20 -07:00
parent 47481b711e
commit fb7424714a
16 changed files with 180 additions and 136 deletions

View File

@@ -2,7 +2,7 @@ import { useState } from 'react';
export function useUniqueKey(len = 10): { key: string; regenerate: () => void } {
const [key, setKey] = useState<string>(() => generate(len));
return { key, regenerate: () => setKey(generate(len)) };
return { key, wasUpdatedExternally: () => setKey(generate(len)) };
}
const CHARS = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';