@app-studio/react-request
v0.0.72
Published
React Request
Downloads
90
Readme
React Request
✨ Features
📦 Install
npm install react-request --save
🔨 Usage
import {useRequest, UseRequestOption} from "react-request";
export const postDataRequest = (
requestBody?: DataBody,
): Promise<Data> => {
return await fetch({
method: 'POST',
path: `/api/data`,
body: requestBody,
});
};
export const usePostDataService = (
options: UseRequestOption = {},
): {
run: (requestBody?: DataBody) => void;
data: any;
loading: boolean;
error?: Error;
params?: any;
} => {
return useRequest(postDataRequest, options);
};
TypeScript
react-request
is written in TypeScript with complete definitions.
🔗 Links
- Change Log
- Versioning Release Note
- FAQ
- CodeSandbox Template for bug reports
- Customize Theme
- How to Apply for Being A Collaborator
🤝 Contributing
Read our contributing guide and let's build a better rize-network together.
We welcome all contributions. Please read our CONTRIBUTING.md first. You can submit any ideas as pull requests or as GitHub issues. If you'd like to improve code, check out the Development Instructions and have a good time! :)
If you are a collaborator, please follow our Pull Request principle to create a Pull Request with collaborator template.
❤️ Sponsors and Backers
Author
SteedMonteiro, [email protected]
License
React Request is available under the MIT license. See the LICENSE file for more info.