CachedDataMap<T> constructor
CachedDataMap<T> ({
- required ChannelType channelType,
- required String channelUrl,
- Map<
String, T> data = const {}, - int? timestamp,
Implementation
CachedDataMap({
required ChannelType channelType,
required String channelUrl,
Map<String, T> data = const {},
int? timestamp,
}) : _channelType = channelType,
_channelUrl = channelUrl {
policy = PeriodEviction(periodInSeconds: 180, evict: evict);
data.forEach((key, value) {
final data = CachedData<T>(
value: value,
ts: timestamp ?? DateTime.now().millisecondsSinceEpoch,
);
_cachedDataMap[key] = data;
});
}