Skip to content

Instantly share code, notes, and snippets.

@object
Last active June 27, 2024 20:26
Show Gist options
  • Save object/54778d46f904d947166b787fbbf5a1d3 to your computer and use it in GitHub Desktop.
Save object/54778d46f904d947166b787fbbf5a1d3 to your computer and use it in GitHub Desktop.
Fable workshop (2024). Step 10. App.fs
module App
open Elmish
open Elmish.React
open Elmish.Bridge
#if DEBUG
open Elmish.Debug
#endif
open Update
open View
Program.mkProgram init update view
|> Program.withBridgeConfig (
Bridge.endpoint "ws://localhost:5000/socket"
|> Bridge.withUrlMode Raw
|> Bridge.withMapping (fun (x : Shared.Sockets.ClientMessage) -> x |> Messages.RemoteEvent))
#if DEBUG
|> Program.withConsoleTrace
#endif
|> Program.withReactSynchronous "elmish-app"
#if DEBUG
|> Program.withDebugger
#endif
|> Program.run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment