0.1.1 • Published 2 years ago

react-native-api-call v0.1.1

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

react-native-api-call

It can be used to call api with minimal code.

Installation

npm install react-native-api-call

Usage

import useApiCall from "react-native-api-call";

// data => Data you want to send to the backend
// ApiUrl => Url of backend server
// submit => Make this value true when you want to call api. Please make sure to set it again false after api completed response.

 const {success, error, loading} = useApiCall(
    data,
    ApiUrl,
    submit,
  );

// success => In success you will get true value when response is ok
// error => In error you will get true value when you get error in api calling
// loading => In loading you will get true/false value based on api completion

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT