Skip to content

Makes cache clearing functions public #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Sources/DataLoader/DataLoader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ final public class DataLoader<Key: Hashable, Value> {
/// Clears the value at `key` from the cache, if it exists. Returns itself for
/// method chaining.
@discardableResult
func clear(key: Key) -> DataLoader<Key, Value> {
public func clear(key: Key) -> DataLoader<Key, Value> {
let cacheKey = options.cacheKeyFunction?(key) ?? key
lock.withLockVoid {
cache.removeValue(forKey: cacheKey)
Expand All @@ -120,7 +120,7 @@ final public class DataLoader<Key: Hashable, Value> {
/// invalidations across this particular `DataLoader`. Returns itself for
/// method chaining.
@discardableResult
func clearAll() -> DataLoader<Key, Value> {
public func clearAll() -> DataLoader<Key, Value> {
lock.withLockVoid {
cache.removeAll()
}
Expand All @@ -130,7 +130,7 @@ final public class DataLoader<Key: Hashable, Value> {
/// Adds the provied key and value to the cache. If the key already exists, no
/// change is made. Returns itself for method chaining.
@discardableResult
func prime(key: Key, value: Value, on eventLoop: EventLoopGroup) -> DataLoader<Key, Value> {
public func prime(key: Key, value: Value, on eventLoop: EventLoopGroup) -> DataLoader<Key, Value> {
let cacheKey = options.cacheKeyFunction?(key) ?? key

lock.withLockVoid {
Expand Down