10 lines
310 B
TypeScript
10 lines
310 B
TypeScript
import { useContext } from "react";
|
|
import { AvatarContext } from "./AvatarProvider";
|
|
|
|
export function useSaveAvatar() {
|
|
const context : any = useContext(AvatarContext);
|
|
if(!context){
|
|
throw new Error("useSaveAvatar must be used within an AvatarProvider");
|
|
}
|
|
return context.saveAvatar;
|
|
} |