Промежуточный этап синхронизации

This commit is contained in:
RoyceDa
2026-02-15 14:56:44 +02:00
parent 40ff99e66d
commit 8b906169ce
15 changed files with 609 additions and 427 deletions

View File

@@ -1,12 +1,12 @@
import { useContext } from "react";
import { ProtocolContext } from "./ProtocolProvider";
import { ProtocolContext, ProtocolContextType, ProtocolState } from "./ProtocolProvider";
export const useProtocolState = () => {
const [context, connect] = useContext(ProtocolContext);
const context : ProtocolContextType = useContext(ProtocolContext);
if(!context){
throw new Error("useProtocol must be used within a ProtocolProvider");
}
return connect;
return [context[1], context[2]] as [ProtocolState, (state: ProtocolState) => void];
};