decayExpireWhenInactive function

DecayFn decayExpireWhenInactive(
  1. Duration after
)

Expires a tag after a certain period of no bumps.

Implementation

DecayFn decayExpireWhenInactive(Duration after) {
  return (value) {
    final now = DateTime.now();
    final rm = now.difference(value.lastVisit) >= after;
    return (0, rm);
  };
}