rescript-model-view-poc
rescript-use-tea
rescript-model-view-poc | rescript-use-tea | |
---|---|---|
1 | 1 | |
1 | 1 | |
- | - | |
10.0 | 10.0 | |
almost 3 years ago | over 1 year ago | |
ReScript | TypeScript | |
- | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
rescript-model-view-poc
-
Why I Use Elm in 2023
Not that I can share unfortunately. But here is the implementation I got the idea from. https://github.com/mjal/rescript-use-tea/blob/master/src/Use...
I defined the actions a little differently and followed the rescript-react pattern of having effects return an Option of a cleanup fn but most of the idea is there.
Looking around just now I also found this PoC of someone doing a very similar thing but all inline with react. https://github.com/mishaszu/rescript-model-view-poc/tree/mai...
Really the only jump you need from react to the elm architecture is having the reducer be (State, Action) -> ('State, Effects) instead of simply returning the new state alone. The then you have a useEffect that invokes the side effect fns, passing in dispatch so they can send updates back to the reducer & so reducer stays pure. There are a bunch of different ways to set that up, and honestly a lot of react apps blunder into an accidental and incomplete version of this anyway it's such a natural model.
rescript-use-tea
-
Why I Use Elm in 2023
Not that I can share unfortunately. But here is the implementation I got the idea from. https://github.com/mjal/rescript-use-tea/blob/master/src/Use...
I defined the actions a little differently and followed the rescript-react pattern of having effects return an Option of a cleanup fn but most of the idea is there.
Looking around just now I also found this PoC of someone doing a very similar thing but all inline with react. https://github.com/mishaszu/rescript-model-view-poc/tree/mai...
Really the only jump you need from react to the elm architecture is having the reducer be (State, Action) -> ('State, Effects) instead of simply returning the new state alone. The then you have a useEffect that invokes the side effect fns, passing in dispatch so they can send updates back to the reducer & so reducer stays pure. There are a bunch of different ways to set that up, and honestly a lot of react apps blunder into an accidental and incomplete version of this anyway it's such a natural model.
What are some alternatives?
Elm - Compiler for Elm, a functional language for reliable webapps.
hn-search - Hacker News Search