#106

Flux Architecture template

OpenTuurlijkopened 1y ago

Hi,

The documentation talks about several architecture patterns, including Flux. Users can benefit from a Flux template.

Activity

4
Tuurlijk1y ago

I made a version of the todo example using https://github.com/redux-rs/redux-rs

Don't know if this is the way to go, but it works.

joshka1y ago

Cool. On the TEA example, we talked a bit about whether to add a template for that, and the same for Ratzilla. I'd prefer not to have to have a bunch of templates that aren't really something that we're actively investing in as it spreads the work a bit too thin. It also tends to collect both good and bad ideas rather than just the good. (The component template is already a bit like this IMO).

Instead I'd encourage using flux a bit in your own apps, understanding the pros and cons of the idea and then extracting that into a template. The good thing about cargo-generate is that there doesn't have to be a central point for all templates. You're welcome to add your own. Perhaps you could add some ideas to the ratatui docs about it based on what you find, some concrete examples wouldn't go astray, or even just a blog article if that's more your thing.

Tuurlijk1y ago

Yes, I kind of hoped that there was a 'this is the true way' kind of architecture. I tried the Elm approach in an app that grew (https://github.com/Tuurlijk/mot/tree/dev/plugins) and now I think I need to rewrite it. I think I'll try the Pages approach the chat app uses, combined with the state store idea from Flux. I'll report/document back what I learn along the way.

Tuurlijk1y ago

Ok, here are the first doodles: https://github.com/Tuurlijk/ratatui-todo-flux-plain/tree/main for a plain flux example and https://github.com/Tuurlijk/ratatui-todo-flux-plain/tree/async for a flux architecture with async tasks.

I'll try to rebuild my app using the async approach and see if it will become more readable.