Skip to content

Commit

Permalink
docs: updated additional parameter allowed input
Browse files Browse the repository at this point in the history
  • Loading branch information
Cadienvan authored Jan 18, 2023
1 parent 5aa566f commit e7d7985
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ users = await cachedGetUsers(); // <-- This will be executed and cached
```

You can pass an additional parameter `dependencyKeys` property which instructs the plugin about which keys to use to invalidate the cache records if necessary.
This property can be either an array of strings, a function that returns an array of strings or a function that returns a Promise fulfilled with an array of strings.
This property can be either a number, a string, an array of strings, a function that returns an array of strings or a function that returns a Promise fulfilled with an array of strings.
Both the function and the Promise will receive the result of the method on which the `cacheCandidate` operates.
In case of an async method, the promise will be fulfilled before passing the result to the `dependencyKeys` function.
The `dependencyKeys` function will be called only if the cache adapter correctly sets the value in the cache (i.e. the `.set` method is fulfilled).
The `dependencyKeys` function will be called only if the cache adapter correctly sets the value in the cache (i.e. the `.set` method is fulfilled).

0 comments on commit e7d7985

Please sign in to comment.