@webkrafters/react-observable-context 4.0.0-rc.7 → 4.0.0-rc.8
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 +6 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -14,6 +14,9 @@
|
|
|
14
14
|
<img alt="NPM" src="https://img.shields.io/npm/l/@webkrafters/react-observable-context">
|
|
15
15
|
<img alt="Maintenance" src="https://img.shields.io/maintenance/yes/2032">
|
|
16
16
|
<img alt="build size" src="https://img.shields.io/bundlephobia/minzip/@webkrafters/react-observable-context?label=bundle%20size">
|
|
17
|
+
<a href="https://www.npmjs.com/package/@webKrafters/react-observable-context">
|
|
18
|
+
<img alt="Downloads" src="https://img.shields.io/npm/dt/@webkrafters/react-observable-context.svg">
|
|
19
|
+
</a>
|
|
17
20
|
<img alt="GitHub package.json version" src="https://img.shields.io/github/package-json/v/webKrafters/react-observable-context">
|
|
18
21
|
</p>
|
|
19
22
|
|
|
@@ -91,7 +94,7 @@ Either of the property paths `a.c.f.1` and `a.c.f[1]` accesses the `[1]=2` prop
|
|
|
91
94
|
A special property path [@@STATE](#fullstate-selectorkey) may be used to access the full given object.<br />
|
|
92
95
|
|
|
93
96
|
<strong id="fullstate-selectorkey"><u>@@STATE</u></strong> is a special property path to access the full state object as a single slice.<br />
|
|
94
|
-
***Caution:***
|
|
97
|
+
***Caution:*** :warning: When this property path exists in a <a href="#selector-map">selector map</a>, any change in the state object results in an update of its <a href="#store"><code>store.data</code></a> and a subsequent render of its client(s).
|
|
95
98
|
|
|
96
99
|
## Provider
|
|
97
100
|
The Provider component is a property of the `React-Observable-Context` context object. As a `React.context` based provider, it accepts the customary `children` and `value` props. It also accepts **2** optional props: <a href="#prehooks"><code>prehooks</code></a> and <a href="#storage"><code>storage</code></a>.
|
|
@@ -179,8 +182,8 @@ The `React.Observable.Context` context `store` is the client's portal into the c
|
|
|
179
182
|
<span style="margin: 5px 10px 0 0">-</span>Performs no state reset when a client with no selector map invokes this method with 0 arguments.
|
|
180
183
|
|
|
181
184
|
<h3 id="store-setstate" style="margin-top:10px"><code>store.setState</code> Usage</h3>
|
|
182
|
-
<b><i>Do this:</i></b> <code>setState({stateKey0: changes0[, ...]});</code><br />
|
|
183
|
-
<b><i>Not this:</i></b> <code>setState({stateKey0: {...state.stateKey0, ...changes0}[, ...]});</code>
|
|
185
|
+
:warning: <b><i>Do this:</i></b> <code>setState({stateKey0: changes0[, ...]});</code><br />
|
|
186
|
+
:warning: <b><i>Not this:</i></b> <code>setState({stateKey0: {...state.stateKey0, ...changes0}[, ...]});</code>
|
|
184
187
|
<h3 id="indexing"><b><i><u>Indexing</u></i></b></h3>
|
|
185
188
|
Existing array state property can be overridden with a new array.<br />
|
|
186
189
|
Use the indexed object to update array content at indexes.<br />
|
package/package.json
CHANGED