A repository to show case the features of the ReactiveUI platform.
iOS |
---|
A repository to show case the features of the ReactiveUI platform.
License: MIT License
Instead of an actual issue here, I have a question regarding the observable subscription dispose in the View Models.
Not sure if it is appropriate to ask a question here.
When I was playing with this repo, I found most of the observable subscriptions in the view models are ending with call DisposeWith().
Take InfiniteScrollViewModel.cs as an example (#47 - #77)
_inventoryDataService
.ChangeSet
.Transform(x =>
new InventoryItemViewModel
{
Id = x.Id,
Brand = x.BrandName,
Coffee = x.CoffeeName,
Roast = x.Roast,
Packaging = x.Packaging
})
.AutoRefresh(x => x.Id)
.DeferUntilLoaded()
.Filter(searchChanged)
.Sort(SortExpressionComparer<InventoryItemViewModel>.Descending(x => x.Roast))
.Page(_pagingSubject.AsObservable())
.ObserveOn(RxApp.MainThreadScheduler)
.Bind(out _items)
.DisposeMany()
.Subscribe()
.DisposeWith(ViewModelSubscriptions);
this.WhenAnyObservable(x => x.Refresh.IsExecuting)
.StartWith(false)
.DistinctUntilChanged()
.ToProperty(this, nameof(IsRefreshing), out _isRefreshing, deferSubscription: true)
.DisposeWith(ViewModelSubscriptions);
this.WhenAnyObservable(x => x.Load.IsExecuting)
.ToProperty(this, nameof(IsLoading), out _isLoading, deferSubscription: true)
.DisposeWith(ViewModelSubscriptions);
By reading the document from ReactiveUI https://www.reactiveui.net/docs/guidelines/framework/dispose-your-subscriptions, it seems like the last two subscriptions are unnecessary to dispose. But the first one is necessary as it will cause the VM to have the reference with _inventoryDataService.
Not sure if my understanding is correct. Thanks for clarification.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.