import 'dart:convert';

import '../../../requestCache.dart';
import 'getSubjects.dart';
import 'getSubjectsResponse.dart';

class GetSubjectsCache extends RequestCache<GetSubjectsResponse> {
  GetSubjectsCache({onUpdate}) : super(RequestCache.cacheHour, onUpdate) {
    start("MarianumMobile", "wu-subjects");
  }

  @override
  Future<GetSubjectsResponse> onLoad() {
    return GetSubjects().run();
  }

  @override
  onLocalData(String json) {
    return GetSubjectsResponse.fromJson(jsonDecode(json));
  }

}