Hooks

|-/hooks 
    |-/phoneVerification
        |- index.ts
        |- useSendVerificationCode.ts
        |- useTime.ts
        |- useVerifyCode.ts

useSendVerificationCode

Functionality

It sends a verification code to a phone number received.

Return Array

const NameTypeDescription

sendCodeToPhone

Function

Method which receives a countryCode, phoneNumber, eventName.

It sends a verification code to the phone provided.

Endpoint: sendCodeToPhone

clearSendVerficiationCode

Function

Set the sendSuccessCode to the initial state.

sendCodeIsLoading

boolean state

Indicates if the request of sending the code is pending.

sendCodeSuccess

boolean state

Indicates if the request of sending the code was successful.

useVerifyCode

Functionality

It verifies if the code entered matches with the code sent to the provided phone number.

Return Array

const NameTypeDescription

verifyCode

Function

Method which receives an entered code, countryCode, phoneNumber.

It verifies through a request that the code and phone number matches.

Endpoint: verifyCode

clearVerifyCode

Function

Set the verifyCodeSuccess to the initial state.

verifyCodeIsLoading

boolean state

Indicates if the request of verifying the code is pending.

verifyCodeSuccess

boolean state

Indicates if the request of verifying the code was successful.

useTime

Functionality

It handles a set of timer intervals based on the time passed. It decreases the timer of the current selected interval and provides the current minutes and seconds. It allows to reset the timer to the preferred interval.

Return Array

const NameTypeDescription

minutes

number state

Current timer minutes

seconds

number state

Current timer seconds

resetTimesFunction

Function

Method that resets current minutes and seconds to the initial state of the received interval timer.

Last updated