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
You can find more examples with live demos [here](/examples).
37
+
**You can find [more examples with live demos here](/examples).**
39
38
40
39
### About decorators
41
40
@@ -52,6 +51,24 @@ You can find more examples with live demos [here](/examples).
52
51
- React native is not yet supported
53
52
- IE is not supported
54
53
54
+
## Key features
55
+
56
+
- Your state can use any valid JavaScript. Feel free to use nested objects, arrays, expando properties, getters/setters, inheritance and ES6 collections directly.
57
+
58
+
- State mutations are picked up and they trigger the render method when appropriate.
59
+
60
+
- The render method is only triggered if it is affected by state mutations. If it doesn't use the mutated part of the state or the mutation doesn't change the state, the render method is not triggered.
61
+
62
+
- The render method is never executed immediately. Triggered renders are collected in a batch and executed in one go after a small delay.
63
+
64
+
- Duplicates renders are removed. A render never runs twice in one batch - no matter how many times it got triggered. Renders run in first trigger order.
65
+
66
+
- Renders may trigger others renders by mutating the state. In this case loops are automatically resolved.
67
+
68
+
- Renders always run before the next repaint.
69
+
70
+
As a result a stable and fresh state and view is always achieved before the next repaint with the minimal number of required renders.
71
+
55
72
## How does it work?
56
73
57
74
Under the hood it uses the [@nx-js/observer-util](https://github.com/nx-js/observer-util) library, which relies on ES6 Proxies to observe state changes. Thanks to the Proxies it doesn't have edge cases or limitations. You can write any JS code without worrying about the render function. [This blog post](https://blog.risingstack.com/writing-a-javascript-framework-data-binding-es6-proxy/) gives a little sneak peek under the hood of the `observer-util`.
0 commit comments