Skip to content

Instantly share code, notes, and snippets.

@Tiagoperes
Created May 28, 2019 13:27
Show Gist options
  • Select an option

  • Save Tiagoperes/034bbca8938d7f347d8debb5c455cfb6 to your computer and use it in GitHub Desktop.

Select an option

Save Tiagoperes/034bbca8938d7f347d8debb5c455cfb6 to your computer and use it in GitHub Desktop.
import { createCacheManager } from '@zup-next/redux-action-cache'
import resources from './resources'
const { profile, wallet, catalog, order } = resources
const cacheManager = createCacheManager({
include: [profile.types.LOAD, wallet.types.LOAD, catalog.types.LOAD],
invalidations: [
{ type: 'pattern', invalidatedBy: /(.+)\/LOAD_ERROR$/, invalidated: '$1/LOAD' },
{ invalidatedBy: order.types.CREATE_SUCCESS, invalidated: wallet.types.LOAD },
],
})
export default cacheManager
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment