Skip to content

Conversation

@glennawatson
Copy link
Contributor

Fixes #2298 where the view model property being changed doesn't trigger a state refresh.

@glennawatson glennawatson requested a review from a team January 6, 2020 03:42
@codecov
Copy link

codecov bot commented Jan 6, 2020

Codecov Report

Merging #2303 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2303   +/-   ##
=======================================
  Coverage   55.32%   55.32%           
=======================================
  Files         113      113           
  Lines        4334     4334           
  Branches      660      660           
=======================================
  Hits         2398     2398           
  Misses       1771     1771           
  Partials      165      165

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 908579d...796fd94. Read the comment docs.

@glennawatson glennawatson merged commit 8d7f45d into master Jan 6, 2020
@glennawatson glennawatson deleted the glennawatson-fix-blazor branch January 6, 2020 03:58
{
var propertyChangedObservable = this.WhenAnyValue(x => x.ViewModel)
this.WhenAnyValue(x => x.ViewModel).Subscribe(_ => StateHasChanged());
var viewModelsPropertyChanged = this.WhenAnyValue(x => x.ViewModel)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this still need a check for null? When I was testing this out, part of the issue is that the event chaining failed when the ViewModel was null.

Adding a .Where(x => x != null) or a default check should resolve that.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or a .WhereNotNull()

@lock lock bot locked and limited conversation to collaborators Apr 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] ReactiveComponentBase doesn't update properties when ViewModel is set/changed

4 participants