gremo/react-directus

[Feature]:Custom Hooks with @tanstack/react-query for Directus Data Fetching and Mutations

Closed this issue · 0 comments

Description

I would like to propose a new feature for the project - the implementation of custom hooks using @tanstack/react-query. This library provides powerful features for request caching, persistent data caching (particularly useful for React Native apps with offline mode), local data mutations, and more.

By integrating @tanstack/react-query with the project, we can create custom hooks for fetching and mutating data via the Directus REST API. This would offer various benefits such as improved performance, data caching, and seamless offline support.

Before proceeding with this enhancement, I wanted to discuss and gather feedback on the potential impact of adding a relatively large library as a dependency.

One of the main use cases for these custom hooks is to develop an unopinionated react-directus-datatable Component, which includes common features like sorting, filtering, editing lines, selecting lines, and more. These features will have direct bindings to Directus, providing a seamless integration experience.

Please share your thoughts on this feature proposal, and I look forward to your valuable feedback.

Thank you for considering this request, and I'm excited about the potential improvements this could bring to the project!

Suggested solution

No response

Are you willing to contribute it?

  • I can work on a pull request to implement this feature