add comment
This commit is contained in:
parent
34df343495
commit
ef9f0ffd69
|
|
@ -226,6 +226,12 @@ export function scrollIntoViewIfNeeded(element: Element | undefined) {
|
|||
const kControlCodesRe = '\\u0000-\\u0020\\u007f-\\u009f';
|
||||
export const kWebLinkRe = new RegExp('(?:[a-zA-Z][a-zA-Z0-9+.-]{2,}:\\/\\/|www\\.)[^\\s' + kControlCodesRe + '"]{2,}[^\\s' + kControlCodesRe + '"\')}\\],:;.!?]', 'ug');
|
||||
|
||||
/**
|
||||
* Manages flash animation state.
|
||||
* Calling `trigger` will turn `flash` to true for a second, and then back to false.
|
||||
* If `trigger` is called while a flash is ongoing, the ongoing flash will be cancelled and after 50ms a new flash is started.
|
||||
* @returns [flash, trigger]
|
||||
*/
|
||||
export function useFlash(): [boolean, EffectCallback] {
|
||||
const [flash, setFlash] = React.useState(false);
|
||||
const trigger = React.useCallback<React.EffectCallback>(() => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue