refactor: share cache revalidation dispatch

This commit is contained in:
Shivam Mishra
2026-06-08 18:47:42 +05:30
parent 625302ac3c
commit 91f2df8834
4 changed files with 51 additions and 15 deletions
@@ -0,0 +1,10 @@
import { cacheableModels } from './cacheableModels';
export const dispatchCacheRevalidations = (store, keys = {}) =>
Promise.all(
cacheableModels
.filter(model => keys[model.name] !== undefined)
.map(model =>
store.dispatch(model.dispatchPath, { newKey: keys[model.name] })
)
);