Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yeliex/rc-promisify
make react-components promisify 🎡
https://github.com/yeliex/rc-promisify
Last synced: about 2 months ago
JSON representation
make react-components promisify 🎡
- Host: GitHub
- URL: https://github.com/yeliex/rc-promisify
- Owner: yeliex
- License: mit
- Created: 2021-09-27T15:14:36.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-09-27T15:47:48.000Z (over 3 years ago)
- Last Synced: 2024-11-11T09:46:58.493Z (about 2 months ago)
- Language: TypeScript
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# rc-promisify
make react-components promisify 🎡
# Usage
```bash
npm install rc-promisify
# OR
yarn add rc-promisify
``````tsx
import { Promisify } from 'rc-promisify';
import { Button, Switch } from 'antd';const App = () => {
const handleClick = async () => {
return new Promise((resolve) => {
setTimeout(resolve, 3000)
});
};return (
<>
>
)
};
```# API Reference
## Promisify
- `component: React.ComponentType` any ReactComponent with event callback and `loading` props
- `trigger: string | string[]` event(s) to hijack
- `...props` any other props of `component`