@rcp/c.preventfastop
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

@rcp/c.preventfastop

NPM version NPM Downloads

Prevent some fast operation (eg. click)

Installation

npm install @rcp/c.preventfastop
# or use yarn
yarn add @rcp/c.preventfastop

Usage

import { PreventFastClick, PreventFastOperation } from '@rcp/c.preventfastop'

const App = () => {
  return (
    <div>
      <PreventFastOperation
        operationName={'onClick'}
        onOperation={async () => {
          await apiSubmit()
        }}
      >
        <Button>提交</Button>
      </PreventFastOperation>
      {/* Same as */}
      <PreventFastClick
        onClick={async () => {
          await apiSubmit()
        }}
      >
        <Button>提交</Button>
      </PreventFastClick>
    </div>
  )
}

API

Related

Authors

This library is written and maintained by 余聪, yucong@yuanfudao.com.

License

MIT

Package Sidebar

Install

npm i @rcp/c.preventfastop

Weekly Downloads

3

Version

2.0.0

License

MIT

Unpacked Size

23.3 kB

Total Files

12

Last publish

Collaborators

  • moyuyc