@isograph/react-disposable-state 0.0.0-main-f49c67bb → 0.0.0-main-35c553b5
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.
@@ -61,7 +61,7 @@ const addItem2ToState = () => {
|
|
61
61
|
|
62
62
|
// get a new active reference to the existing item1
|
63
63
|
const [item1ActiveReference, disposeItem1ActiveReference] = nullthrows(
|
64
|
-
state[0].cloneIfNotDisposed()
|
64
|
+
state[0].cloneIfNotDisposed(),
|
65
65
|
);
|
66
66
|
setState([item1ActiveReference, item2ActiveReference], () => {
|
67
67
|
disposeItem1ActiveReference();
|
@@ -94,7 +94,7 @@ const removeItem2FromState = () => {
|
|
94
94
|
|
95
95
|
// get a new active reference to the existing item1
|
96
96
|
const [item1ActiveReference, disposeItem1ActiveReference] = nullthrows(
|
97
|
-
state[0].cloneIfNotDisposed()
|
97
|
+
state[0].cloneIfNotDisposed(),
|
98
98
|
);
|
99
99
|
setState([item1ActiveReference], () => {
|
100
100
|
disposeItem1ActiveReference();
|
@@ -133,12 +133,12 @@ For example:
|
|
133
133
|
```ts
|
134
134
|
type MyState =
|
135
135
|
| {
|
136
|
-
kind:
|
136
|
+
kind: 'ConnectedToDatabase';
|
137
137
|
connectionToDatabase: ConnectionToDatabase;
|
138
138
|
currentUserId: number;
|
139
139
|
}
|
140
140
|
| {
|
141
|
-
kind:
|
141
|
+
kind: 'DisconnectedFromDatabase';
|
142
142
|
};
|
143
143
|
```
|
144
144
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@isograph/react-disposable-state",
|
3
|
-
"version": "0.0.0-main-
|
3
|
+
"version": "0.0.0-main-35c553b5",
|
4
4
|
"description": "Primitives for managing disposable state in React",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"types": "dist/index.d.ts",
|
@@ -16,7 +16,7 @@
|
|
16
16
|
"prepack": "yarn run compile"
|
17
17
|
},
|
18
18
|
"dependencies": {
|
19
|
-
"@isograph/disposable-types": "0.0.0-main-
|
19
|
+
"@isograph/disposable-types": "0.0.0-main-35c553b5",
|
20
20
|
"react": "^18.2.0"
|
21
21
|
},
|
22
22
|
"devDependencies": {
|