CustomZipRepository<Data> constructor

CustomZipRepository<Data>({
  1. Duration? autoRefreshInterval,
  2. bool resolveOnCreate = true,
})

A Repository that combines multiple Repositorys into one. It takes a list of data of each repository and returns a single zipped data. It is useful when you want to combine multiple repositories into one.

Implementation

CustomZipRepository({
  super.autoRefreshInterval,
  super.resolveOnCreate,
}) {
  ZipStream(repositories.map((e) => e.stream), _zipper).listen((data) {
    // Whenever any of the repositories emit new data, zip
    //the data from all repositories and emit it
    // to the stream of this repository.

    emit(data: data);
  });
}