Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/davestewart/axios-actions
Bundle endpoints as callable, reusable services
https://github.com/davestewart/axios-actions
api endpoints rest
Last synced: 13 days ago
JSON representation
Bundle endpoints as callable, reusable services
- Host: GitHub
- URL: https://github.com/davestewart/axios-actions
- Owner: davestewart
- Created: 2018-07-09T10:18:06.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T08:17:18.000Z (almost 2 years ago)
- Last Synced: 2024-10-15T06:40:03.096Z (29 days ago)
- Topics: api, endpoints, rest
- Language: TypeScript
- Homepage: https://axios-actions.netlify.com
- Size: 2.1 MB
- Stars: 188
- Watchers: 3
- Forks: 15
- Open Issues: 46
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Axios Actions
> Bundle endpoints as callable, reusable services
## Abstract
Axios Actions comprises a small set of classes which collate URLs or URL request configs as callable actions.
First, [define](docs/config.md) your endpoints:
```js
const actions = {
: '',
: '',
...
}
```Then, encapsulate them as one of the built-in [services](docs/classes/README.md):
```js
const service = new (axios, actions)
```Finally, [call](docs/classes/ApiGroup.md#usage) them:
```js
service
.()
.then()
```This service-based approach:
- removes brittle configuration from components and stores
- encapsulates additional logic (such as load state and handlers) within the service
- ensures application code stays simple and semantic
- provides a dedicated layer for API interactionThere are lots of [other goodies](docs/tips.md) in the library which take the drudgery out of working with APIs!
## Documentation
Start reading:
- [Quick start](docs/quick-start.md)
- [Full docs](docs/README.md)## Next steps
Demos:
- [axios-actions/demo](demo)
Installation:
```bash
npm i -S axios-actions
```