Skip to content

Commit f7a9a10

Browse files
nubbelnicksrandall
authored andcommitted
Fix usage example (#29)
The return type of `BatchFunc` is defined as a slice of *pointers* to `Result`, i.e. `[]*Result`. However, in the usage example the pointers were missing.
1 parent 0197025 commit f7a9a10

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ This project is a work in progress. Feedback is encouraged.
1414
## Usage
1515
```go
1616
// setup batch function
17-
batchFn := func(ctx context.Context, keys []string) []dataloader.Result {
18-
var results []dataloader.Result
17+
batchFn := func(ctx context.Context, keys []string) []*dataloader.Result {
18+
var results []*dataloader.Result
1919
// do some aync work to get data for specified keys
2020
// append to this list resolved values
2121
return results
@@ -27,7 +27,7 @@ loader := dataloader.NewBatchedLoader(batchFn)
2727
/**
2828
* Use loader
2929
*
30-
* A thunk is a function returned from a function that is a
30+
* A thunk is a function returned from a function that is a
3131
* closure over a value (in this case an interface value and error).
3232
* When called, it will block until the value is resolved.
3333
*/

0 commit comments

Comments
 (0)