Add MobX store, create observable User.

This commit is contained in:
Paul
2021-07-29 12:41:28 +01:00
parent 781fa5de10
commit cf3930b094
10 changed files with 247 additions and 61 deletions

View File

@@ -14,6 +14,7 @@ import { AuthState } from "../../redux/reducers/auth";
import Preloader from "../../components/ui/Preloader";
import { useData } from "../../mobx/State";
import { Children } from "../../types/Preact";
import { useIntermediate } from "../intermediate/Intermediate";
import { registerEvents, setReconnectDisallowed } from "./events";
@@ -157,9 +158,10 @@ function Context({ auth, children }: Props) {
};
}, [client, auth.active]);
const store = useData();
useEffect(
() => registerEvents({ operations }, setStatus, client),
[client],
() => registerEvents({ operations }, setStatus, client, store),
[client, store],
);
useEffect(() => {