loadNew method

  1. @override
AdeptPublishSubject<Resource<ResourceData?>> loadNew({
  1. List<Param>? params,
  2. AdeptPublishSubject<Resource<ResourceData?>>? publishSubject,
})
override

Implementation

@override
AdeptPublishSubject<Resource<ResourceData?>> loadNew(
    {List<Param>? params,
    AdeptPublishSubject<Resource<ResourceData?>>? publishSubject}) {
  publishSubject ??= this.publishSubject;
  return ResourceLoader<ResourceData?>(
      publishSubject: publishSubject,
      loadFromCache: () async {
        try {
          return dao.load() as ResourceData?;
        } catch (e) {
          //If there is an exception here means Data can't cast to ResourceData then this method should be Overridden
          print(e);
        }
        return null;
      }).asPublishSubject();
}