Skip to content

Commit 84e7f4f

Browse files
Fix #147 and other corrections in UseElmish post
1 parent 73295a0 commit 84e7f4f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

docs/blog/2022/2022-10-13-use-elmish.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ let private mkProgram () =
4242
|> Program.withSubscription (fun model ->
4343
[
4444
if model.CheckFriendsStatus then
45-
["friends-status"], (fun model ->
46-
let id = startWebSocket()
45+
["friends-status"], (fun dispatch ->
46+
let id = startWebSocket(dispatch)
4747
mkDisposable (fun () -> closeWebSocket(id)))
4848
])
4949
```
@@ -83,4 +83,6 @@ let App () =
8383

8484
You can check [this example](https://github.com/alfonsogarciacaro/fable-react-sample/blob/3fc0f5ca2411432d3a34e12344fcca2a4ba6a4ce/src/TodoMVC.fs#L198) to quickly test Fable.React.UseElmish. Just clone the repository and run `npm install && npm start` to launch a development server, and try editing the code in TodoMVC.fs to see the web contents updated on the fly. Please give it a try and let us know what you think!
8585

86-
> In order for React Fast Refresh to work, files must include **only one JS export**. This means you should only expose one functional component (decorated with `Feliz.ReactComponent` or `JSX.Component`) and the rest of the code in the file must be private.
86+
> In order for React Fast Refresh to work, files must **export only React components**, that is, functions decorated with `Feliz.ReactComponent` or `JSX.Component` and using PascalCase. The rest of the code in the file must be private.
87+
88+
Special thanks to Eugene Tolmachev, Maxime Mangel, Zaid Ajaj, Cody Johnson and all the other contributors that have turned writing React apps in F# into such a great development experience!

0 commit comments

Comments
 (0)