checkAndExpire method

  1. @override
Future<bool> checkAndExpire(
  1. String key
)
override

Checks if the key has expired and deletes it if it has Returns true if the key was deleted Returns false if the key was not deleted

Implementation

@override
Future<bool> checkAndExpire(String key) async {
  checkInitialized();

  if (data.containsKey(key)) {
    int expiration = data[key]!;
    if (ReownCoreUtils.isExpired(expiration)) {
      await expire(key);
      return true;
    }
  }

  return false;
}