mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-19 16:21:13 +01:00
Better multi-window updates
This commit is contained in:
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user