⚡ FlexF
Axios flex fetch
Proof Of Concept: Project/Library in initial state.
Response Lookup
Axios response reference
"data": {},
"status": null
"statusText": null,
"headers": {},
"config": {},
"request": {}
const axios = require("axios").default;
const { flexF, responseLookup } = require("flexf");
const response = responseLookup(
flexF(axios)({
/* config */
})
);
const result = response("data"); // response reference
Shorthand methods for Axios HTTP requests
Axios also provides a set of shorthand methods for performing different types of requests. The methods are as follows:
- [x] request
- [x] get
- [x] delete
- [x] head
- [x] options
- [x] post
- [x] put
- [x] patch
Request Config: requestConfig
Follow The Request Config documentation provided by axios.
Request example
const axios = require("axios").default;
const { flexF, responseLookup } = require("flexf");
const r = responseLookup(
await flexF(axios)({
method: "get",
url: "https://jsonplaceholder.typicode.com/todos/",
requestConfig: {
params: {
id: 1,
},
responseType: "json",
},
})
);
const result = r("data");
🤝 Contributing
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request
👥 Credits
- Chris Michael (Project Leader, and Developer)
💢 Troubleshootings
This is just a personal project created for study / demonstration purpose and to simplify my working life, it may or may not be a good fit for your project(s).
❤️ Show your support
Please
Feel free to open issues or submit pull-requests to help me improving my work.
🤖 Author
Chris Michael
Copyright ©2021 flexF.