mirror of
https://github.com/morten-olsen/refocus.dev.git
synced 2026-02-08 00:46:25 +01:00
fix: improved UI
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { useCallback, useEffect, useRef } from 'react';
|
||||
import { useUpdateEffect } from '../widgets';
|
||||
|
||||
type AutoUpdateOptions<TReturn> = {
|
||||
interval: number;
|
||||
@@ -36,6 +37,10 @@ const useAutoUpdate = <T>(
|
||||
};
|
||||
}, [interval, actionWithCallback, callbackWithCallback]);
|
||||
|
||||
useUpdateEffect(async () => {
|
||||
await update();
|
||||
}, [update]);
|
||||
|
||||
return update;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user