Closed ties-v closed 4 years ago
Thanks for your feedback @ties-v. While it would be useful, I think providing a useApi
hook is beyond the scope of this library. There's people using swr
, GraphQL, websockets, ... that might have a variety of needs when it comes to interacting with other systems.
The only thing I think would make sense is a hook which can wrap a library, eg: a hook where you can provide axios, a GraphQL client, ...
On a second thought, you are right @sandrinodimattia !
Also a wrapper is probably not that useful as it also differs per use case how often data needs to be fetched etc., so I will close this one.
PS: I was wondering if you have any plans for the future with this repo or is it mostly a proof of concept?
πThanks for this simple and straight forward package @sandrinodimattia! It is now almost no work to setup client side auth in react apps βπ!
Suggested feature
Because SPA's usually need data from an API, I suggest to include the
useApi
hook in this package. This is the sameuseApi
as you use in the example. If you agree I would be happy to create a PR for it π.