import {useMutation} from "@tanstack/react-query";
import auth from "@react-native-firebase/auth";
import {useRouter} from "expo-router";

export const useSignOut = () => {
    const {replace} = useRouter();
    return useMutation({
        mutationKey: ["signOut"],
        mutationFn: async () => {
            await auth().signOut()
            replace("/(unauth)")
        }
    });
}