Created
November 26, 2018 12:45
-
-
Save serhatsezer/579f10e8726865bbefbe3b0bf6d887c1 to your computer and use it in GitHub Desktop.
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
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