deleteOutOfDate method

  1. @override
Future<void> deleteOutOfDate()

Deletes all data that is out of date.

Implementation

@override
Future<void> deleteOutOfDate() async {
  await prefs
      .getKeys()
      .map(prefs.getString)
      .nonNulls
      .map(jsonDecode)
      .map((e) => e as Map<String, Object?>)
      .map(PersistedSpValue.fromJson)
      .where(PersistedSpValue.isExpired)
      .map((e) => e.key)
      .map(prefs.remove)
      .wait;
}