BoraBora
BoraBora

Reputation: 565

How to write a Javascript API wrapper

This is a question about how implement a Javascript wrapper in best way. I'm coding a react client and i have a set of API. These API returns a lot of datas that client don't needs. What i want to do is to write a wrapper, an index.js where call API, get the response and re map it in order to exclude useless datas. I know that isn't the best approch, but i have few days of work and this seems the faster solution. What is the best way to do this? Or, better, what is the cleaner way to do this? Thank you in advance.

Upvotes: 2

Views: 989

Answers (1)

Dmitriy Kovalenko
Dmitriy Kovalenko

Reputation: 3616

Take a look to Normalizer. It allows you to normalize some api responses and exclude useless data.

Upvotes: 1

Related Questions