fsprojects / FSharp.Compiler.PortaCode

The PortaCode F# code format and corresponding interpreter. Used by Fabulous and others.
Other
42 stars 11 forks source link

extension of generic type, needs FCS support: IObservable`1::member Add #16

Closed 7sharp9 closed 3 years ago

7sharp9 commented 5 years ago

Mirroring the issue I logged in FCSWatch for observable support.

https://github.com/humhei/FCSWatch/issues/38

The reason I needed this was a subscription after initialisation is needed to restart the event loop after a hot reload.

Sort of like this:

    let subUpdateLoop (game: ElmishGame) dispatch =
        let msgSender msg = msg |> Tick |> dispatch
        game.UpdateEvent.Add(msgSender)

    let init game = 
        initModel game, Cmd.ofSub (subUpdateLoop game)