The-Commit-Company / frappe-react-sdk

React hooks for Frappe
https://frappe-react.vercel.app
MIT License
110 stars 36 forks source link

Update documentation to for all hooks and fix loading state examples #3

Open yjane99 opened 2 years ago

yjane99 commented 2 years ago

Documentation for 'frappe-react-sdk' mentions handling loading state if it is validating. However, SWR documnetation - Quick start suggests another method that we've been already using all along. Also this discussion clarifies the confusion. If you find it appropriate, the documentation for this SDK can be amended as it returns similar states.

I hope this helps...Thank you!

nikkothari22 commented 2 years ago

@yjane99 - you are correct. To be clear, isValidating is when a request is mid-flight. However, since SWR caches every request, the user should still see the old 'stale' data.

We had already started amending the documentation. The docs on the Auth hook had been updated.

However, the rest of the hooks have not been updated yet - so we need to do that. Actually, most of the documentation is pending since we have only covered 2 database hooks while there are hooks for API calls, Search, other CRUD operations and File upload. We need to write documentation for all these as well.

yjane99 commented 2 years ago

I appreciate you clarifying this. If there is anything that I can help, I'm up.