Пример #1
0
 private IObservable <IChangeSet <IModListingGetter> > InternalGet(out IObservable <ErrorResponse> state)
 {
     return(ObservableCacheEx.And(
                FileReader.Get(out state)
                .AddKey(x => x.ModKey),
                FolderWatcher.Get()
                .Transform <IModListingGetter, ModKey, ModKey>(x => new ModListing(x, true)))
            .RemoveKey());
 }
        public IObservable <IImmutableGroupChangeSet <TObject, TKey, TGroup> > Run()
        {
            return(_source.Publish(shared =>
            {
                // Monitor explicit property changes
                var regrouper = ObservableCacheEx.WhenValueChanged <TObject, TKey, TGroup>(shared, _propertySelector, (bool)false).ToUnit();

                //add a throttle if specified
                if (_throttle != null)
                {
                    regrouper = regrouper.Throttle(_throttle.Value, _scheduler ?? Scheduler.Default);
                }

                // Use property changes as a trigger to re-evaluate Grouping
                return shared.GroupWithImmutableState(_groupSelector, regrouper);
            }));
        }