@webqit/observer 3.8.11 → 3.8.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -9
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -82,26 +82,22 @@ This limitation in the language has long created a **blindspot** — and a **wea
|
|
|
82
82
|
state = { ...state, count: 8 };
|
|
83
83
|
```
|
|
84
84
|
|
|
85
|
-
```js
|
|
85
|
+
```js
|
|
86
86
|
state = { ...state, items: [...state.items, 'new item 1'] };
|
|
87
87
|
state = { ...state, items: [...state.items, 'new item 2'] };
|
|
88
88
|
state = { ...state, items: [...state.items, 'new item 3'] };
|
|
89
89
|
```
|
|
90
90
|
|
|
91
|
-
> Because this is generally hard to follow, frameworks typically enforce immutability
|
|
91
|
+
> Because this is generally hard to follow, frameworks typically enforce immutability using strong design constraints. Outside of a framework, you get standalone *immutability* libraries (like Immer, or Immutable.js back in the day) that as well try to simulate an immutable world, where data is never changed, only replaced.
|
|
92
92
|
|
|
93
93
|
+ mutation gets a bad rap
|
|
94
94
|
|
|
95
95
|
**Using the Observer API:**
|
|
96
96
|
|
|
97
|
-
By enabling observability at the object/array level, the Observer API effectively solves reactivity for a mutable world. Consequently:
|
|
98
|
-
|
|
99
|
-
+ you are able to weild *the sheer power of mutability* in programming to your advantage — and unappologetically
|
|
100
|
-
+ you are able to make sense of a mutable world — and integrate with it — rather than stand at odds with it.
|
|
101
|
-
|
|
102
|
-
The Observer API collapses layers of complexity that reactive frameworks have built around immutability, bringing you back to the simplicity and power of direct mutation—and this time, with full observability.
|
|
97
|
+
By enabling observability at the object/array level, the Observer API effectively solves reactivity for a mutable world. **The Result** is *mutation-based reactivity* as a first-class concept in JavaScript. Consequently:
|
|
103
98
|
|
|
104
|
-
|
|
99
|
+
+ you are able to weild *the sheer power of mutability* in programming to your advantage
|
|
100
|
+
+ you are able to make sense of a mutable world — and integrate with it — rather than stand at odds with it
|
|
105
101
|
|
|
106
102
|
## Quick Start
|
|
107
103
|
|