Skip to content

Commit

Permalink
fix: stale ttl value could be 0
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed Aug 19, 2021
1 parent 787bc0f commit 694ea16
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/memoize/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ function memoize (
hasExpires && !isUndefined(staleTtl) ? staleTtl(data.value) : false

const isExpired = staleTtlValue === false && hasExpires && ttlValue < 0
const isStale = staleTtlValue && ttlValue < staleTtlValue
const isStale = staleTtlValue !== false && ttlValue < staleTtlValue
const info = { hasValue, key, isExpired, isStale }
const done = value => (objectMode ? [value, info] : value)

Expand Down

0 comments on commit 694ea16

Please sign in to comment.