Skip to content

Commit

Permalink
Write caching better
Browse files Browse the repository at this point in the history
  • Loading branch information
apedroferreira committed Feb 21, 2025
1 parent 057ce7d commit 758798e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/data/toolpad/core/components/crud/crud.md
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,9 @@ Data sources cache fetched data by default. This means that if the user queries

Successfully calling mutation methods such as `createOne`, `updateOne` or `deleteOne` automatically clears the cache for all queries in the same data source.

It is recommended to always pass an instance of `DataSourceCache` to the `dataSourceCache` prop in order to cache data, as seen in the [demo above](#demo), otherwise by default the cache will be scoped to the component being used. `DataSourceCache` is a simple in-memory cache that stores the data in a plain object.
It is recommended to always include the `dataSourceCache` prop in order to cache data at the scope of whole application, otherwise by default the cache will only be scoped to the component being used.

Check warning on line 294 in docs/data/toolpad/core/components/crud/crud.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Google.Will] Avoid using 'will'. Raw Output: {"message": "[Google.Will] Avoid using 'will'.", "location": {"path": "docs/data/toolpad/core/components/crud/crud.md", "range": {"start": {"line": 294, "column": 153}}}, "severity": "WARNING"}

An instance of `DataSourceCache` may be used for caching as seen in the [demo above](#demo). `DataSourceCache` is a simple in-memory cache that stores the data in a plain object.

Each data source should have its own single cache instance across the whole application.

Expand Down

0 comments on commit 758798e

Please sign in to comment.