data-provider/core

Cache invalidation. Relation resolver. CRUD methods

ckoliber opened this issue · 2 comments

Hey friend,

Thank you for publishing this great module

I've worked with React-Admin before, and i search a lot for something that manages the api calls and cache

Now i thing i found it

But it needs to improve more

Some of the most important features that your plugin needed, are:

  1. Cache invalidate timeout
  2. Relation resolver
  3. Basic CRUD methods support (Optional custom methods)

Hi @ckoliber! Thank you for your feedback, I'm glad you like it! I know it needs to improve, so I continue working on it and comments like yours are really appreciated 🙂

About the features you need:

  1. Cache invalidate timeout: You have two options available for this:
  • cacheTime: After this time, the cache will be invalidated, so the readMethod will be executed again when read is called. The cleanCache event is not triggered, so UI binding plugins will not know about it, and will not request data again automatically (as the react plugin does, for example).
  • cleanCacheInterval: The cache is automatically cleaned every defined interval. The cleanCache event is triggered each time the cache is cleaned.
    You can read more about this options in the Provider api docs
  1. Relation resolver: I don't understand exactly what do you mean, but maybe selectors can do what you are looking for (here is where the power of the library really is).

  2. Basic CRUD methods support: This is not implemented in the core, as it is agnostic about the data origin, but specific addons are adding this support. For example, the Axios addon (used to build REST API clients) provides this feature, as well as the browser-storage addon, which can be used to build localStorage and sessionStorage clients.

I recommend you to read the basic tutorial, which will guide you through the process of creating a simple TODO app in React using the library and the Axios addon, so you can get an idea of how the library works and what are its benefits and motivations.

And don't dude to ask for support again if you have more questions, you'll be welcome!

Closed due to project discontinuation