Skip to content

Commit c4c59f9

Browse files
Makes cache clearing functions public
1 parent bc8ec06 commit c4c59f9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Sources/DataLoader/DataLoader.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ final public class DataLoader<Key: Hashable, Value> {
108108
/// Clears the value at `key` from the cache, if it exists. Returns itself for
109109
/// method chaining.
110110
@discardableResult
111-
func clear(key: Key) -> DataLoader<Key, Value> {
111+
public func clear(key: Key) -> DataLoader<Key, Value> {
112112
let cacheKey = options.cacheKeyFunction?(key) ?? key
113113
lock.withLockVoid {
114114
cache.removeValue(forKey: cacheKey)
@@ -120,7 +120,7 @@ final public class DataLoader<Key: Hashable, Value> {
120120
/// invalidations across this particular `DataLoader`. Returns itself for
121121
/// method chaining.
122122
@discardableResult
123-
func clearAll() -> DataLoader<Key, Value> {
123+
public func clearAll() -> DataLoader<Key, Value> {
124124
lock.withLockVoid {
125125
cache.removeAll()
126126
}
@@ -130,7 +130,7 @@ final public class DataLoader<Key: Hashable, Value> {
130130
/// Adds the provied key and value to the cache. If the key already exists, no
131131
/// change is made. Returns itself for method chaining.
132132
@discardableResult
133-
func prime(key: Key, value: Value, on eventLoop: EventLoopGroup) -> DataLoader<Key, Value> {
133+
public func prime(key: Key, value: Value, on eventLoop: EventLoopGroup) -> DataLoader<Key, Value> {
134134
let cacheKey = options.cacheKeyFunction?(key) ?? key
135135

136136
lock.withLockVoid {

0 commit comments

Comments
 (0)