repletes - v1.1.0
    Preparing search index...

    Function decide

    • The whole policy, over one entry, at one instant.

      State Condition What a read does
      fresh age <= freshFor serves, no work
      stale within freshFor + staleWhileRevalidate serves now, refreshes behind
      retained within freshFor + staleIfError serves only if the action failed
      miss beyond retention, or absent calls the action

      A clock that went backwards is treated as an entry stored this instant. A store handing back something from the future is not a reason to throw.

      Type Parameters

      • T

      Parameters

      • entry: Entry<T> | undefined
      • now: number

      Returns Decision<T>