Repository<Data> constructor
If resolveOnCreate
is true, the repository will resolve itself on
creation.
If autoRefreshInterval is not null, the repository will refresh itself
every autoRefreshInterval.
Implementation
Repository({
this.autoRefreshInterval,
bool resolveOnCreate = true,
}) {
track();
hydrate(refreshAfter: resolveOnCreate);
if (autoRefreshInterval != null) {
timer = Timer.periodic(
autoRefreshInterval!,
(_) => refresh(),
);
}
}