@open-pioneer/reactivity 0.1.0 → 2.2.0
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/CHANGELOG.md +7 -0
- package/README.md +14 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -77,6 +77,20 @@ export class Model {
|
|
|
77
77
|
}
|
|
78
78
|
```
|
|
79
79
|
|
|
80
|
+
#### Rendering a single reactive value
|
|
81
|
+
|
|
82
|
+
If you have a single signal at hand, there is no need to use the more complex `useReactiveSnapshot` hook.
|
|
83
|
+
You can use the more primitive `useReactiveValue` hook instead:
|
|
84
|
+
|
|
85
|
+
```jsx
|
|
86
|
+
import { useReactiveValue } from "@open-pioneer/reactivity";
|
|
87
|
+
|
|
88
|
+
function YourComponent({ signal }) {
|
|
89
|
+
const value = useReactiveValue(signal); // Subscribes to `signal.value` and re-renders on changes.
|
|
90
|
+
return <div>{value}</div>;
|
|
91
|
+
}
|
|
92
|
+
```
|
|
93
|
+
|
|
80
94
|
More details are available in this package's API documentation and the [README of @conterra/reactivity-core](https://www.npmjs.com/package/@conterra/reactivity-core).
|
|
81
95
|
|
|
82
96
|
### ESLint configuration
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@open-pioneer/reactivity",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "2.2.0",
|
|
5
5
|
"description": "Provides integration for the reactivity API.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"open-pioneer-trails"
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
17
|
"react": "^18.3.1",
|
|
18
|
-
"@conterra/reactivity-core": "^0.4.
|
|
18
|
+
"@conterra/reactivity-core": "^0.4.2"
|
|
19
19
|
},
|
|
20
20
|
"exports": {
|
|
21
21
|
"./package.json": "./package.json",
|