Skip to content

Instantly share code, notes, and snippets.

@serhatsezer
Created November 26, 2018 12:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save serhatsezer/579f10e8726865bbefbe3b0bf6d887c1 to your computer and use it in GitHub Desktop.
Save serhatsezer/579f10e8726865bbefbe3b0bf6d887c1 to your computer and use it in GitHub Desktop.
let gitHubProvider = MoyaProvider<GitHub>(plugins: [MoyaCacheablePlugin()])
extension GitHub: MoyaCacheable {
var cachePolicy: MoyaCacheablePolicy {
switch self {
case .userProfile:
return .returnCacheDataElseLoad
default:
return .reloadIgnoringLocalAndRemoteCacheData
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment