r/purescript • u/azafeh • Apr 03 '20
purescript-flame: cool & well documented alternative Elm like frontend framework
GitHub | Documentation website
Hello everyone! I shamelessly took purescript-hedwig and added more features to make a complete Elm like frontend framework. Including:
- Different ways to handle application events
- Server side rendering (a la React hydration)
- Signals for arbitrary custom events
- Some convenience type classes and functions for the DSL markup
Following the links above, there are plenty of examples and documentation. There is still need of a few polishing touches (like adding benchmarks), but overall it is stable and I am quite happy using it on my own projects (e.g. here).
46
Upvotes
View all comments
Show parent comment
1
u/untrff Apr 04 '20
Actually, I think I read it correctly originally, and it seems a bit problematic. The entire model does get reset to its value back when the Aff operation was started, plus whatever changes are initiated only by that operation.
For example, take your affjax sample, and stick an extra `Aff.delay` of a few seconds in the request, to give some more time. If you kick off the request, and then quickly type some characters into the input box, then when the reply comes back, the input box gets reset to the contents back when the Aff operation was started.
It seems more intuitive/useful to me if this worked differently. eg there wasn't a `model` parameter to the `World.update` function at all, just a `message`, and the library provided the most recent value of the model to the user's `update` function. Does this make sense?