ResEntry.fromResource constructor

ResEntry.fromResource(
  1. ResClient client,
  2. String type,
  3. String rid
)

Implementation

factory ResEntry.fromResource(ResClient client, String type, String rid) {
  switch (type) {
    case 'model':
      return ResModel(client, rid);
    case 'collection':
      return ResCollection(client, rid);
    default:
      throw CacheInconsistenyException(
          'the cache tried to spawn the unknown type $type for $rid', null);
  }
}