Our great sponsors
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
Looking at the number of opened bugs and lack of releases, I wouldn't call it rock solid.
https://github.com/elm/compiler/issues
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.
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.
I knew you'd show up here, fully erect.
https://hn.algolia.com/?dateRange=all&page=0&prefix=false&qu...
Related posts
- Learning Elm by porting a medium-sized web front end from React (2019)
- Can you make your own JavaScript by implementing ECMAScript standard?
- What is the best way to present the user the results of Haskell computations?
- Building React Components Using Unions in TypeScript
- What's the state of the Elm repo? · Issue #2308 · elm/compiler