@webkrafters/react-observable-context 4.1.0-alpha.1 → 4.1.0-alpha.2
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 +9 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -200,15 +200,16 @@ store.setState({ ...state, a: { ...state.a, b: [ { ...first, y: 30 }, 22, ...res
|
|
|
200
200
|
```
|
|
201
201
|
|
|
202
202
|
<h3 id="setstate-tags"><b><i><u>Rewriting state using tag commands</u></i></b></h3>
|
|
203
|
-
By default <code>store.setState</code> merges new changes into current state
|
|
203
|
+
By default, <code>store.setState</code> recursively merges new changes into current state.<br />
|
|
204
|
+
To overwrite current state slices with new values, <b>7</b> tag commands have been provided:
|
|
204
205
|
<ol>
|
|
205
|
-
<li><span style="margin-left: 10px"><
|
|
206
|
-
<li><span style="margin-left: 10px"><
|
|
207
|
-
<li><span style="margin-left: 10px"><
|
|
208
|
-
<li><span style="margin-left: 10px"><
|
|
209
|
-
<li><span style="margin-left: 10px"><
|
|
210
|
-
<li><span style="margin-left: 10px"><
|
|
211
|
-
<li><span style="margin-left: 10px"><
|
|
206
|
+
<li><span style="margin-left: 10px"><b style="margin-right: 6px"><i>@@CLEAR:</i></b> sets state slice to its corresponding empty value</span></li>
|
|
207
|
+
<li><span style="margin-left: 10px"><b style="margin-right: 6px"><i>@@DELETE:</i></b> removes plain object properties and array items</span></li>
|
|
208
|
+
<li><span style="margin-left: 10px"><b style="margin-right: 6px"><i>@@MOVE:</i></b> moves array elements</span></li>
|
|
209
|
+
<li><span style="margin-left: 10px"><b style="margin-right: 6px"><i>@@PUSH:</i></b> pushes new items into an array</span></li>
|
|
210
|
+
<li><span style="margin-left: 10px"><b style="margin-right: 6px"><i>@@REPLACE:</i></b> replaces property values</span></li>
|
|
211
|
+
<li><span style="margin-left: 10px"><b style="margin-right: 6px"><i>@@SET:</i></b> sets property values</span></li>
|
|
212
|
+
<li><span style="margin-left: 10px"><b style="margin-right: 6px"><i>@@SPLICE:</i></b> splices array items</span></li>
|
|
212
213
|
</ol>
|
|
213
214
|
<b>Examples:</b><br /><br />
|
|
214
215
|
|
package/package.json
CHANGED