refactor: share cache revalidation dispatch
This commit is contained in:
@@ -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] })
|
||||
)
|
||||
);
|
||||
Reference in New Issue
Block a user