Skip to content

Commit 7d62cc4

Browse files
author
Nick Randall
committed
add interface to prime interface
1 parent 704a603 commit 7d62cc4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

dataloader.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ type Interface interface {
2424
LoadMany(context.Context, []interface{}) ThunkMany
2525
Clear(context.Context, string) Interface
2626
ClearAll() Interface
27-
Prime(ctx context.Context, key string, value interface{}) Interface
27+
Prime(ctx context.Context, key interface{}, value interface{}) Interface
2828
}
2929

3030
// BatchFunc is a function, which when given a slice of keys (string), returns an slice of `results`.
@@ -351,7 +351,7 @@ func (l *Loader) ClearAll() Interface {
351351

352352
// Prime adds the provided key and value to the cache. If the key already exists, no change is made.
353353
// Returns self for method chaining
354-
func (l *Loader) Prime(ctx context.Context, key string, value interface{}) Interface {
354+
func (l *Loader) Prime(ctx context.Context, key interface{}, value interface{}) Interface {
355355
if _, ok := l.cache.Get(ctx, key); !ok {
356356
thunk := func() (interface{}, error) {
357357
return value, nil

0 commit comments

Comments
 (0)