You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Sources/Apollo/ApolloClientProtocol.swift
+21-6Lines changed: 21 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -9,13 +9,15 @@ public protocol ApolloClientProtocol: class {
9
9
/// A function that returns a cache key for a particular result object. If it returns `nil`, a default cache key based on the field path will be used.
10
10
varcacheKeyForObject:CacheKeyForObject?{getset}
11
11
12
-
/// Clears the underlying cache.
13
-
/// Be aware: In more complex setups, the same underlying cache can be used across multiple instances, so if you call this on one instance, it'll clear that cache across all instances which share that cache.
14
-
///
12
+
/// Clears the cache store according to the specified policy.
13
+
/// - Warning: The cache may be used by other clients. Calling this method will affect all clients using the same cache!
15
14
/// - Parameters:
16
-
/// - callbackQueue: The queue to fall back on. Should default to the main queue.
17
-
/// - completion: [optional] A completion closure to execute when clearing has completed. Should default to nil.
Copy file name to clipboardExpand all lines: Sources/Apollo/ApolloStore.swift
+29-13Lines changed: 29 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -45,18 +45,34 @@ public final class ApolloStore {
45
45
}
46
46
}
47
47
48
-
/// Clears the instance of the cache. Note that a cache can be shared across multiple `ApolloClient` objects, so clearing that underlying cache will clear it for all clients.
49
-
///
50
-
/// - Returns: A promise which fulfills when the Cache is cleared.
48
+
/// Clears all records from the cache.
49
+
/// - Warning: If this cache is shared between multiple `ApolloClient` objects, each client will be affected by the change in the cache.
50
+
/// - Parameters:
51
+
/// - callbackQueue: An optional callback queue to execute the `completion` handler on. The default is `.main`.
52
+
/// - completion: An optional completion handler to execute when the cache has been cleared according the specified policy.
53
+
/// - Returns: A promise which fulfills when the cache has been cleared.
0 commit comments