Skip to content

Instantly share code, notes, and snippets.

@MrMjauh
Created June 12, 2019 11:47
Show Gist options
  • Save MrMjauh/70e48b819816c32b5370f801c25adc74 to your computer and use it in GitHub Desktop.
Save MrMjauh/70e48b819816c32b5370f801c25adc74 to your computer and use it in GitHub Desktop.
Cache Actions and Creators
export enum CacheActionType {
CACHE_CLEANUP = "CACHE_CLEANUP",
CACHE_PURGE_ITEM = "CACHE_PRUGE_ITEM"
}
export function cleanupCache(): Action<CacheActionType> {
return {
type: CacheActionType.CACHE_CLEANUP
};
}
export interface ActionCachePurgeItem extends Action<CacheActionType> {
key: CacheKey;
}
export function purgeFromCache(key: CacheKey): ActionCachePurgeItem {
return {
type: CacheActionType.CACHE_PURGE_ITEM,
key: key
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment