Files
chatwoot/app/javascript/dashboard/helper/CacheHelper/dispatchCacheRevalidations.js
T

11 lines
314 B
JavaScript

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] })
)
);