mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
feat: consumable timings
This commit is contained in:
1 parent
8f098d435a
commit
809f807da8
11 files changed
+145
-46
No files matched your search
@@ -0,0 +1,11 @@
|
||||
import { useEffect, useRef } from 'react';
|
||||
|
||||
export function useDelta(value: number) {
|
||||
const lastValue = useRef(value);
|
||||
|
||||
useEffect(() => {
|
||||
lastValue.current = value;
|
||||
});
|
||||
|
||||
return value - lastValue.current;
|
||||
}
|
||||
Reference in new issue
Block a user