-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Description
Describe the problem
The documentation section on Runes Deep State is quite hard to understand.
Specifically it seems from the conversation in this Reddit thread , that many people fail to grasp after reading it, what the benefits or relevance of it is. I didn't get it straight away, but was overjoyed when I realised how useful it was.
Describe the proposed solution
To have a preliminary section that introduces the topic with a message that follows the pattern "if you want to achieve this, then deep state can help you like this...". (I believe that an active-voice introduction will pull the reader into the topic).
To illustrate:
"The DEEP STATE capabilities of Runes $(state) help, when you have for example a Component composed of several related sub components which conceptually all use a data model in common, and where changes to the state in one might need to ripple or propagate changes to the others. In this case you can define a single rune $state object as the data model that can be shared (imported) into all the components that want it. With this arrangement any change to any field in that object will trigger reactivity in all the consumers of that field. It's called DEEP because changes propagate up from the fields to the parent object. And it works (recursively) if you nest objects - which lets you craft a well structured view model". It also helps you to manage the interplay logic in the data model in a dedicated place, leaving the components to focus on rendering the view.
Importance
nice to have