You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Any state accessed in the component will cause the component to render when a mutation occurs on that state. Overmind actually uses the same approach to change detection as Vue itself. When using the plugin any component can access any state, though the only overhead that is added to the application is an instance of a "tracking tree" per component. This might sound scary, but it is a tiny little object that adds a callback function to Overmind as long as the component lives.These tracking trees are even reused as components unmount.
24
+
Any state accessed in the component will cause the component to render when a mutation occurs on that state. Overmind actually uses the same approach to change detection as Vue itself. When using the plugin any component can access any state, though the only overhead that is added to the application is an instance of a "tracking tree" per component. This might sound scary, but it is a tiny little object that adds a callback function to Overmind as long as the component lives.These tracking trees are even reused as components unmount.
You can now access the **admin** state and actions directly with **state** and **actions**.
57
57
58
58
59
-
### Rendering
60
-
Any state accessed in the component will cause the component to render when a mutation occurs on that state. Overmind actually uses the same approach to change detection as Vue itself.
61
-
62
-
### Pass state as props
63
-
64
-
If you pass a state object or array as a property to a child component you will also in the child component need to **connect**. This ensures that the property you passed is tracked within that component, even though you do not access any state or actions from Overmind. The devtools will help you identify where any components are left "unconnected".
Vue has its own observable concept that differs from Overmind. That means you can not use Overmind state inside a computed and expect the computed cache to be busted when the Overmind state changes. But computeds are really for caching expensive computation, which you will not do inside a component using Overmind anyways.
@@ -83,4 +64,4 @@ What you might want is to introduce some logic, maybe combine som data from prop
0 commit comments