'init'
This commit is contained in:
13
app/providers/TransportProvider/useTransport.ts
Normal file
13
app/providers/TransportProvider/useTransport.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { useContext } from "react";
|
||||
import { TransportContext } from "./TransportProvider";
|
||||
|
||||
|
||||
export function useTransport() {
|
||||
const context = useContext(TransportContext);
|
||||
if(!context){
|
||||
throw new Error("useTransport must be used within a TransportProvider");
|
||||
}
|
||||
const { uploadFile, downloadFile } = context;
|
||||
|
||||
return { downloadFile, uploadFile };
|
||||
}
|
||||
Reference in New Issue
Block a user