OptionsMonitor<TOptions> constructor

OptionsMonitor<TOptions>(
  1. OptionsFactory<TOptions> factory,
  2. Iterable<OptionsChangeTokenSource<TOptions>> sources,
  3. OptionsMonitorCache<TOptions> cache
)

Implementation

OptionsMonitor(
  OptionsFactory<TOptions> factory,
  Iterable<OptionsChangeTokenSource<TOptions>> sources,
  OptionsMonitorCache<TOptions> cache,
)   : _factory = factory,
      _cache = cache {
  for (var source in sources.toList()) {
    var registration = ChangeToken.onChangeWithState(
      () => source.getChangeToken(),
      _invokeChanged,
      source.name,
    );

    _registrations.add(registration);
  }
}