2.0.0 • Published 2 months ago

@rcp/c.preventfastop v2.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

@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

2.0.0

2 months ago

1.2.2

2 years ago

1.2.1

2 years ago

1.2.0

2 years ago