You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice to be able to invalidate rows cached by the useAsyncDataSource hook.
My API suggestion would be to return an additional object in this hook, say a "cache" object, which encapsulates the internal cache and allows some control from the outside.
Perhaps this could be the type def for this cache:
interfaceAsyncDataSourceCache<TData>{/** * Gets the cached object (if there is any) for the given row. */get: (row: number)=>TData|undefined/** * Invalidate the given cached rows, when no rows are specified, the entire cache is invalidated. */invalidate(rows?: number[])=>void}
This allows easy access to cached row objects, which can come in handy when processing the grid events. It also allows invalidating any rows (say, by controlling their timestamp or whatever logic the client needs).
Currently, I have a component that needs this type of functionality and I had to resort to changing the component's key just to "clear" the internal state of the hook.
The text was updated successfully, but these errors were encountered:
It would be nice to be able to invalidate rows cached by the
useAsyncDataSource
hook.My API suggestion would be to return an additional object in this hook, say a "cache" object, which encapsulates the internal cache and allows some control from the outside.
Perhaps this could be the type def for this cache:
This allows easy access to cached row objects, which can come in handy when processing the grid events. It also allows invalidating any rows (say, by controlling their timestamp or whatever logic the client needs).
Currently, I have a component that needs this type of functionality and I had to resort to changing the component's key just to "clear" the internal state of the hook.
The text was updated successfully, but these errors were encountered: