4.0.2 • Published 5 years ago
axios-actions v4.0.2
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 your endpoints:
const actions = {
<action>: '<url>',
<action>: '<config>',
...
}
Then, encapsulate them as one of the built-in services:
const service = new <ApiClass>(axios, actions)
Finally, call them:
service
.<action>(<data>)
.then(<handler>)
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 interaction
There are lots of other goodies in the library which take the drudgery out of working with APIs!
Documentation
Start reading:
Next steps
Demos:
Installation:
npm i -S axios-actions
4.0.2
5 years ago
4.0.1
5 years ago
4.0.0
5 years ago
3.1.2
5 years ago
3.1.1
5 years ago
3.1.0
5 years ago
3.0.0
5 years ago
2.1.2
6 years ago
2.1.1
6 years ago
2.1.0
6 years ago
2.0.2
6 years ago
2.0.1
6 years ago
2.0.0
6 years ago
1.0.1
6 years ago
1.0.0
6 years ago
1.0.0-beta-2
6 years ago
1.0.0-beta-1
6 years ago
1.0.0-alpha-1
6 years ago
1.0.0-alpha
6 years ago