rapidjs / rapid.js

An ORM-like Interface and a Router For Your API Requests
https://rapidjs.drewjbartlett.com
711 stars 45 forks source link

Add preprocessing hook function for result of request #14

Closed chuoke closed 6 years ago

drewjbartlett commented 7 years ago

I actually had this feature and then removed it on initial release. This can actually be achieved in the apiConfig. Check out transformRequest on axios as well: https://github.com/mzabriskie/axios#request-config.

I suppose I could write a wrapper around transformRequest in the config called parse () {} or something

chuoke commented 7 years ago

Understand. but what if just use rapid without axios ? How to do what such as preprocessing ? That is awesome you do, I have same annoyance, but no time and not professional, so I wish you can do it better !

drewjbartlett commented 7 years ago

As of now there's no way to use rapid without axios. It's dependent on axios as its promise-based http client. So all requests are actually made through it. Either way, I can definitely add my own version of this soon!