Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[hdom] question about state management #238

Open
Korede-TA opened this issue Jul 23, 2020 · 2 comments
Open

[hdom] question about state management #238

Korede-TA opened this issue Jul 23, 2020 · 2 comments

Comments

@Korede-TA
Copy link

first of all, thanks for this really cool set of libraries i've felt really productive using these so far!

context: i've been working on a small project based on the HDOM, and i've been using global variables pretty arbitrarily to represent state. i've started running into snags with state updates, which make sense since i'm now doing state updates asynchronously via the FileReader API.

Q: i'm trying to figure out which one of the state management mechanisms provided in this repo which i could most easily use as a replacement. I've toyed with the @thing/atom package, but i don't really need any undo/redo functionality or anything fancy, just something to handle this async case that requires minimal state changes. It seems like there's a bunch of different possible approaches here, so I want to figure out the best way to go about it.

@nkint
Copy link
Contributor

nkint commented Jul 23, 2020

Hi @Korede-TA , here it is a not exhaustive answer, hope this helps a little :)

There are few different ways of handling state managements, here some examples from the doc:

FYI there a new package for manipulating the DOM more tightly related with stream/reactive programming paradigm: thi.ng/rdom so IMHO could worth to use rstream (there are several examples with hdom).

Anyway the strength of atom package is not only for undo/redo but also in the immutable state paradigm (together with the thi.ng/paths package to have lenses over complex object).

@loganpowell
Copy link
Contributor

+1 for rstream !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants