safeResponseDataCache<T> method

Future<void> safeResponseDataCache<T>({
  1. required String? keyCache,
  2. required dynamic funCallBack(
    1. T?
    ),
})

Implementation

Future<void> safeResponseDataCache<T>(
    {required String? keyCache, required Function(T?) funCallBack}) async {
  if (keyCache?.isNotEmpty == true) {
    final cacheData = await responseCacheData<T>(key: keyCache!);
    if (cacheData != null) {
      funCallBack(cacheData);
    }
  }
}