Skip to content

Instantly share code, notes, and snippets.

@ricardopsantos
Created January 16, 2023 14:42
Show Gist options
  • Save ricardopsantos/dac5cb4578e19789b5f32396ee74708f to your computer and use it in GitHub Desktop.
Save ricardopsantos/dac5cb4578e19789b5f32396ee74708f to your computer and use it in GitHub Desktop.
Article_13_G7.swift
public typealias GenericRequestWithCacheResponse<T1: Codable, E1: Error> = AnyPublisher<T1, E1>
static func genericRequestWithCache<T1: Codable, E1: Error, T2: Codable, E2: Error>(
_ publisher: AnyPublisher<T2, E2>,
_ type: T1.Type,
_ cachePolicy: CachePolicy,
_ serviceKey: String,
_ serviceParams: [String],
_ cacheManager: CodableCacheManagerProtocol = SimpleCacheManagerForCodable.shared) -> GenericRequestWithCacheResponse<T1, E1>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment