'init'
This commit is contained in:
12
app/providers/ProtocolProvider/useProtocolState.ts
Normal file
12
app/providers/ProtocolProvider/useProtocolState.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { useContext } from "react";
|
||||
import { ProtocolContext } from "./ProtocolProvider";
|
||||
|
||||
export const useProtocolState = () => {
|
||||
const [context, connect] = useContext(ProtocolContext);
|
||||
|
||||
if(!context){
|
||||
throw new Error("useProtocol must be used within a ProtocolProvider");
|
||||
}
|
||||
|
||||
return connect;
|
||||
};
|
||||
Reference in New Issue
Block a user