/** * @license * Copyright Stbui All Rights Reserved. * https://github.com/stbui/prophet */ import { useCallback } from 'react'; import { useHistory } from 'react-router'; import { useDispatch } from 'react-redux'; import useAuthProvider, { defaultAuthParams } from './useAuthProvider'; import { clearState } from '../actions'; type Logout = ( params?: any, redirectTo?: string, redirectToCurrentLocationAfterLogin?: boolean ) => Promise; /** * * @example * * import { useLogout } from 'prophet-core'; * * const LoginButton = () => { * const logout = useLogout(); * const onClick = () => logout(); * return