Closed Feroks closed 5 years ago
Hi @Feroks
Indeed, the initial value of State
was never observed. It wasn't really intentional because I was thinking that it is up to the developer to separate the initialization of a component (using the initialState
) and then update it using the ObserveState
.
But now I realise that you can handle the initialization and the update logic inside the Subscribe
method.
I will make the changes in the source code. BTW, thank you for the BehaviorSubject
shortcut. I never knew we could do that.
Ey @Feroks
I updated the nuget package so you can now upgrade to version 2.0. This issue is a breaking change so I moved from 1.2 to 2.0.
Thank you for your feedback.
I am having a singleton Store that i inject into my ViewModel. When i navigate to it i am subscribing to changes in store like this.
My problem is that it does not fire for initial value, because you are using
Subject<TState>()
instead ofBehaviorSubject<TState>(initialState)
. Is this by intention or not? As of now, my only alternative is to use.StartWith(Store.State.IsEnabled)
, but this is not that pretty.