I am upgrading Elmish.Bridge.Client package from 6x to 7x and can't figure out how to update the following code:
let bridgeSubscription (state: State) =
Bridge.endpoint state.AppSettings.SocketUrl
|> Bridge.withUrlMode Raw
|> Bridge.withMapping (fun x -> x |> MediaSetEvent)
|> Bridge.asSubscription
Program.mkProgram init update view
|> Program.withSubscription (bridgeSubscription >> Cmd.ofSub)
|> Program.withReactSynchronous "elmish-app"
|> Program.withDebugger
|> Program.run
It works fine with Elmish.Bridge.Client prior to version 7, but version 7 replaced ofSub with ofEffect, so this code no longer compiles. But I can't just replace Cmd.ofSub with Cmd.ofEffect because they have different messages and compiler fails with the following error:
Type mismatch. Expecting a
'((Messages.Msg -> unit) -> unit) -> Sub'
but given a
'Effect -> Cmd'
The type 'SubId * Subscribe' does not match the type 'Effect'F# Compiler1
val ofEffect:
effect: Effect<'msg>
-> Cmd<'msg>
Can you point me to a code example that works with the newer syntax? Thanks.
I am upgrading Elmish.Bridge.Client package from 6x to 7x and can't figure out how to update the following code:
It works fine with Elmish.Bridge.Client prior to version 7, but version 7 replaced ofSub with ofEffect, so this code no longer compiles. But I can't just replace Cmd.ofSub with Cmd.ofEffect because they have different messages and compiler fails with the following error:
Can you point me to a code example that works with the newer syntax? Thanks.