question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Observable.Add(handler) to a ISignal doesn't execute the handle function when the property value has changed

See original GitHub issue

As the title suggest, when trying to Observable.Add( handler ) there is an issue where, when changing the property binded to this Observable, the handler is not called.

This issue has been reproduced in the FSI by referencing only Gjallarhorn.dll. The steps are the following :

run the following code line by line by sending it to F# interactive. The last 3 lines, do not trigger any of the two observables handlers.


module test =
    type V = { A : int ; B : int }

    let v = Mutable.create { A = 0 ; B = 0 } 

    let a = v |> Signal.map (fun v -> v.A) 
    let b = v |> Signal.map (fun v -> v.B) 

    a |> Observable.add (fun a -> printfn "A changed to %d" a) 
    b |> Observable.add (fun b -> printfn "B changed to %d" b) 

    v.Value <- { v.Value with A = 12 } 
    v.Value <- { v.Value with B = 2 }
    v.Value <- {A = 5 ; B = 6} ```

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ReedCopseycommented, Feb 3, 2017

Fixed in 0.0.9 - now on NuGet https://www.nuget.org/packages/Gjallarhorn.Bindable.Wpf/

Let me know if you have any other issues.

0reactions
FoggyFindercommented, Jan 31, 2017

thanks, got it - I did not pay attention to the “line by line” =(

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - ObservableCollection PropertyChanged event
I want to subclass ObservableCollection to add a property to it. Unfortunately, the PropertyChanged event is protected. Basically, I want to ...
Read more >
ObservableCollection not noticing when Item in it changes ...
Here is a drop-in class that sub-classes ObservableCollection and actually raises a Reset action when a property on a list item changes.
Read more >
Using observables to pass values
Observables are declarative —that is, you define a function for publishing values, but it is not executed until a consumer subscribes to it....
Read more >
Observables compared to other techniques
Observables are very similar to event handlers that use the events API. Both techniques define notification handlers, and use them to process multiple...
Read more >
Signals in Angular – How to Write More Reactive Code
When the onQuantitySelected() method has completed its execution, Angular's change detection can finally run. The template reads the signal, and ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found