Skip to content

Commit

Permalink
docs: Updating README with RemovalReason instead of RemovalCause
Browse files Browse the repository at this point in the history
  • Loading branch information
aholstenson committed Apr 4, 2019
1 parent 6c427eb commit 72333e3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,20 +253,20 @@ Caches support a single removal listener that will be notified when items in
the cache are removed.

```javascript
import { RemovalCause } from 'transitory';
import { RemovalReason } from 'transitory';
const cache = newCache()
.withRemovalListener((key, value, reason) => {
switch(reason) {
case RemovalCause.EXPLICIT:
case RemovalReason.EXPLICIT:
// The user of the cache requested something to be removed
break;
case RemovalCause.REPLACED:
case RemovalReason.REPLACED:
// A new value was loaded and this value was replaced
break;
case RemovalCause.SIZE:
case RemovalReason.SIZE:
// A value was evicted from the cache because the max size has been reached
break;
case RemovalCause.EXPIRED:
case RemovalReason.EXPIRED:
// A value was removed because it expired due to its max age
break;
}
Expand Down

0 comments on commit 72333e3

Please sign in to comment.