fix(app): latch startup store readiness
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
export function useLatchedBoolean(value: boolean): boolean {
|
||||
const [hasLatched, setHasLatched] = useState(value);
|
||||
|
||||
useEffect(() => {
|
||||
if (value) {
|
||||
setHasLatched(true);
|
||||
}
|
||||
}, [value]);
|
||||
|
||||
return hasLatched || value;
|
||||
}
|
||||
Reference in New Issue
Block a user