Elm Architecture / Flux / Redux-style Global State Store
See original GitHub issueHello Chris,
I found re-wx
from a reply to my HackerNews comment at https://news.ycombinator.com/item?id=28328165.
I’d like to build a re-wx app with a global state store and the Model-View-Update / The Elm Architecture / Flux / Redux pattern. Here’s my use case:
1.) Have a main thread running the GUI that users click on buttons and see readouts of the state in Gauges and StaticTexts 2.) Have several other threads running in the app that are doing background tasks. It’s important to know that these background tasks aren’t triggered from the user interacting with the UI except for the initial launch, which should spawn 3 threads that start doing stuff (downloading) in the background.
As these tasks get completed, the background threads send messages
using a Queue
. An update
function takes in the current state, a message from the queue, and produces a new global state. Ideally, that would cause the re-wx app to render and show updated messages in the Gauge and StaticText readouts of the download progress.
Essentially a multithreaded downloader?
Would you be able to share a toy script of how you’d implement a global state store and update that state store from outside the re-wx app but still cause the re-wx app to render?
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (3 by maintainers)
Top GitHub Comments
Sweet, the Child components example is working with
0.0.6
. Thank you for helping out!Sure, here’s a small example to get you started.
You can scale this out to pretty complex things. Here’s a youtube-download clone in re-wx.