Shared/global state and computed/derived state? #63
mindplay-dk
started this conversation in
General
Replies: 2 comments 9 replies
-
Since I am traveling I will make my answer brief. I will provide a detailed answer after I am back. Global state is possible with code like this: const globalState = {
state1: van.state(...),
state2: van.state(...),
...
} Derived states are possible, see the implementation of the |
Beta Was this translation helpful? Give feedback.
9 replies
-
Hi @mindplay-dk, VanJS |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
Interesting little framework. 🙂👍
I was wondering about two features I don't see in this framework.
First, shared (or global) state: the ability to have state independent of component instances. I'm sure you've seen how people struggle with React, trying to cram everything into component state - before realizing they need a state management library of some sort.
Secondly, any plans to support computed (derived) state? In order to reap the real benefits of reactive state, we need to be able to both store and compute states - for example, how would you compute the number of TODO items in a list and display that?
Building a reactive state manager with shared and derived state might be a little more involved than you might think. 😊
Beta Was this translation helpful? Give feedback.
All reactions