@webkrafters/react-observable-context 2.1.9 → 2.1.10

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.
Files changed (2) hide show
  1. package/README.md +5 -3
  2. package/package.json +6 -4
package/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # React-Observable-Context
2
2
 
3
- Only re-renders subscribing components on context state change. A subscribing component decides which context state properties' change trigger its update.
3
+ A context bearing an observable consumer [store](#store).\
4
+ Only re-renders subscribing components on context state change.\
5
+ Subscribing component decides which context state properties' change trigger its update.
4
6
 
5
7
  **Name:** React-Observable-Context
6
8
 
@@ -43,8 +45,8 @@ The context's `store` exposes **4** methods for interacting with the context's i
43
45
  * **resetState**: VoidFunction // resets the state to the Provider initial `value` prop.
44
46
 
45
47
  * **setState**: (changes: PartialState\<State\>) => void // sets only new/changed state slices.\
46
- ***Do this:*** <code style="color:#080">setState({stateKey0: changes0[, ...]});</code>\
47
- ***Not this:*** <code style="color:#800">setState({stateKey0: {...state.stateKey0, ...changes0}[, ...]});</code>
48
+ $\textcolor{#080}{\textbf{\textit{Do\ this:}}}$ `setState({stateKey0: changes0[, ...]});`\
49
+ $\textcolor{#800}{\textbf{\textit{Not\ this:}}}$ `setState({stateKey0: {...state.stateKey0, ...changes0}[, ...]});`
48
50
 
49
51
  * **subscribe**: (listener: (newValue: PartialState\<State\>, oldValue: PartialState\<State\>) => void) => ***UnsubscribeFunction***
50
52
 
package/package.json CHANGED
@@ -7,14 +7,12 @@
7
7
  "steveswork <stephen.isienyi@webkrafting.com> (https://github.com/steveswork)"
8
8
  ],
9
9
  "dependencies": {
10
- "@types/react": "^18.0.17",
11
10
  "lodash.clonedeep": "^4.5.0",
12
11
  "lodash.has": "^4.5.2",
13
12
  "lodash.isempty": "^4.4.0",
14
13
  "lodash.isequal": "^4.5.0",
15
14
  "lodash.isplainobject": "^4.0.6",
16
- "lodash.omit": "^4.5.0",
17
- "react": "^18.2.0"
15
+ "lodash.omit": "^4.5.0"
18
16
  },
19
17
  "description": "Observable react context - prevents an automatic total component tree tear-down and re-rendering during context updates.",
20
18
  "devDependencies": {
@@ -40,6 +38,7 @@
40
38
  "eslint-plugin-react": "^7.31.11",
41
39
  "eslint-plugin-standard": "^5.0.0",
42
40
  "jest-cli": "^26.6.3",
41
+ "react": "^18.2.0",
43
42
  "react-dom": "^18.2.0",
44
43
  "react-performance-testing": "^2.0.0",
45
44
  "typescript": "^4.8.2"
@@ -66,6 +65,9 @@
66
65
  "license": "MIT",
67
66
  "main": "index.js",
68
67
  "name": "@webkrafters/react-observable-context",
68
+ "peerDependencies": {
69
+ "react": ">= 16.8.0"
70
+ },
69
71
  "publishConfig": {
70
72
  "access": "public"
71
73
  },
@@ -79,5 +81,5 @@
79
81
  "test:watch": "eslint --fix && jest --updateSnapshot --watchAll"
80
82
  },
81
83
  "types": "dist/index.d.ts",
82
- "version": "2.1.9"
84
+ "version": "2.1.10"
83
85
  }