GV14982 / async-airtable

A lightweight npm package to handle working with the Airtable API.
https://www.npmjs.com/package/asyncairtable
MIT License
54 stars 5 forks source link

🚨 Figure out a better return type for the rateLimitHandler function #32

Closed GV14982 closed 3 years ago

GV14982 commented 4 years ago

Currently the asyncAirtable#rateLimitHandler method currently has a return type of Promise<any>, which is not ideal and causing a linter warning.

We need to come up with a better return type to handle this.

MoralCode commented 3 years ago

this seems like it stems from the resolve(data) line. maybe Promise<object> would be slightly more specific if the promise resolves with the value of the JSON from the request. might also need to make a custom type thats object | Error to make sure it covers the error case.

Alternatively, maybe use generics and have the caller specify what type it is expecting since it is the one making the request and probably knows what the format of the data is expected to be

GV14982 commented 3 years ago

Addressed with #77