Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-context-form-timer

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-context-form-timer

Auto-request for sms token

  • 0.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

React context form timer

Usage

<AutoRequestProvider
    phoneLength={12}
    groupName="phone"
    onBeforeRequest={() => console.log("Sending sms...")}
    onFailRequest={(error: AxiosError) => console.log(error)}
    onSuccessRequest={(response: AxiosResponse<any>) => console.log(response)}
    request={(cancelToken: CancelTokenSource): Promise<any> => axios.get("/api", { cancelToken: cancelToken.token() })}
>
    <PhoneValidator>
        <Input />
    </PhoneValidator>
    <TimerButton
        waitTime={30}
        disabled={this.state.disabled}
        timerIcon={<i className="icon icon-sms"/>}
        onTimeout={() => console.log("Time is over")}
    />
</AutoRequestProvider>

where

  • phoneLength - length of string of phone. Optional. Default = 12.
  • groupName - name of validation group.
  • onSuccessRequest - will call if sms request was succefull. Optional.
  • onFailRequest - will call if sms request was failed. Optional.
  • onBeforeRequest - will call before request. Optional.
  • request - will call on request.
  • waitTime - count of seconds. Optional. Default = 30.
  • timerIcon - markup, that rendered on unactive timer. Optional. Default = <i className="icon icon-sms"/>
  • onTimeout - will call when time is over. Optional.
  • disabled - control of auto sending. Optional.

*Note: When disabled will change value from false to true, provider will try to do request

Keywords

FAQs

Package last updated on 23 Jun 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc