hurshi / dio-http-cache

http cache lib for Flutter dio like RxCache
Apache License 2.0
274 stars 223 forks source link

Make all async method await-able #4

Closed yevyevyev closed 5 years ago

yevyevyev commented 5 years ago

Currently, almost all methods inside cache manager are asynchronous by nature but they are not marked as async, so you cannot await them to make a delete operation before retrieving from the cache.

delete(String key, {String subKey}) {
    key = _convertMd5(key);
    if (null != subKey) subKey = _convertMd5(subKey);

    _memoryCacheStore?.delete(key, subKey: subKey);
    _diskCacheStore?.delete(key, subKey: subKey);
  }
hurshi commented 5 years ago

Thank you for correcting my mistake.
I have fixed it in the new version.