registerCollection<Y> method

void registerCollection<Y>(
  1. String collection, {
  2. bool syncCollectionToServer = false,
  3. Duration cacheLifespan = const Duration(hours: 6),
})

Implementation

void registerCollection<Y>(
  String collection, {
  bool syncCollectionToServer = false,
  Duration cacheLifespan = const Duration(hours: 6),
}) {
  if (_collections.any((element) => element.name == collection)) {
    return;
  } else {
    _collections.add(
      DataCollection<Y>(collection, syncToServer: syncCollectionToServer),
    );
  }
}