Skip to content

Commit

Permalink
[refactoring / simplification] Remove passed generics that have a suf…
Browse files Browse the repository at this point in the history
…ficient default value
  • Loading branch information
Philzen committed Jan 22, 2025
1 parent a7773ab commit 8779e0c
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 74 deletions.
10 changes: 1 addition & 9 deletions packages/auth/src/AuthProvider/useForgotPassword.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ export const useForgotPassword = <
TSignUp,
TGetTokenOptions,
TForgotPassword,
TResetPasswordOptions,
TResetPassword,
TValidateResetToken,
TClient,
>(
authImplementation: AuthImplementation<
TUser,
Expand All @@ -28,11 +24,7 @@ export const useForgotPassword = <
TSignUpOptions,
TSignUp,
TGetTokenOptions,
TForgotPassword,
TResetPasswordOptions,
TResetPassword,
TValidateResetToken,
TClient
TForgotPassword
>,
) => {
return useCallback(
Expand Down
29 changes: 2 additions & 27 deletions packages/auth/src/AuthProvider/useLogIn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,37 +7,12 @@ import { spaDefaultAuthProviderState } from './AuthProviderState.js'
import type { useCurrentUser } from './useCurrentUser.js'
import { useReauthenticate } from './useReauthenticate.js'

export const useLogIn = <
TUser,
TRestoreAuth,
TLogInOptions,
TLogIn,
TLogOutOptions,
TLogOut,
TSignUpOptions,
TSignUp,
TGetTokenOptions,
TForgotPassword,
TResetPasswordOptions,
TResetPassword,
TValidateResetToken,
TClient,
>(
export const useLogIn = <TUser, TRestoreAuth, TLogInOptions, TLogIn>(
authImplementation: AuthImplementation<
TUser,
TRestoreAuth,
TLogInOptions,
TLogIn,
TLogOutOptions,
TLogOut,
TSignUpOptions,
TSignUp,
TGetTokenOptions,
TForgotPassword,
TResetPasswordOptions,
TResetPassword,
TValidateResetToken,
TClient
TLogIn
>,
setAuthProviderState: React.Dispatch<
React.SetStateAction<AuthProviderState<TUser>>
Expand Down
18 changes: 1 addition & 17 deletions packages/auth/src/AuthProvider/useLogOut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,14 @@ export const useLogOut = <
TLogIn,
TLogOutOptions,
TLogOut,
TSignUpOptions,
TSignUp,
TGetTokenOptions,
TForgotPassword,
TResetPasswordOptions,
TResetPassword,
TValidateResetToken,
TClient,
>(
authImplementation: AuthImplementation<
TUser,
TRestoreAuth,
TLogInOptions,
TLogIn,
TLogOutOptions,
TLogOut,
TSignUpOptions,
TSignUp,
TGetTokenOptions,
TForgotPassword,
TResetPasswordOptions,
TResetPassword,
TValidateResetToken,
TClient
TLogOut
>,
setAuthProviderState: React.Dispatch<
React.SetStateAction<AuthProviderState<TUser>>
Expand Down
6 changes: 1 addition & 5 deletions packages/auth/src/AuthProvider/useResetPassword.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ export const useResetPassword = <
TForgotPassword,
TResetPasswordOptions,
TResetPassword,
TValidateResetToken,
TClient,
>(
authImplementation: AuthImplementation<
TUser,
Expand All @@ -30,9 +28,7 @@ export const useResetPassword = <
TGetTokenOptions,
TForgotPassword,
TResetPasswordOptions,
TResetPassword,
TValidateResetToken,
TClient
TResetPassword
>,
) => {
return useCallback(
Expand Down
14 changes: 1 addition & 13 deletions packages/auth/src/AuthProvider/useSignUp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@ export const useSignUp = <
TLogOut,
TSignUpOptions,
TSignUp,
TGetTokenOptions,
TForgotPassword,
TResetPasswordOptions,
TResetPassword,
TValidateResetToken,
TClient,
>(
authImplementation: AuthImplementation<
TUser,
Expand All @@ -30,13 +24,7 @@ export const useSignUp = <
TLogOutOptions,
TLogOut,
TSignUpOptions,
TSignUp,
TGetTokenOptions,
TForgotPassword,
TResetPasswordOptions,
TResetPassword,
TValidateResetToken,
TClient
TSignUp
>,
setAuthProviderState: React.Dispatch<
React.SetStateAction<AuthProviderState<TUser>>
Expand Down
4 changes: 1 addition & 3 deletions packages/auth/src/AuthProvider/useValidateResetToken.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export const useValidateResetToken = <
TResetPasswordOptions,
TResetPassword,
TValidateResetToken,
TClient,
>(
authImplementation: AuthImplementation<
TUser,
Expand All @@ -31,8 +30,7 @@ export const useValidateResetToken = <
TForgotPassword,
TResetPasswordOptions,
TResetPassword,
TValidateResetToken,
TClient
TValidateResetToken
>,
) => {
return useCallback(
Expand Down

0 comments on commit 8779e0c

Please sign in to comment.