Created
June 12, 2019 11:47
-
-
Save MrMjauh/70e48b819816c32b5370f801c25adc74 to your computer and use it in GitHub Desktop.
Cache Actions and Creators
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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