@yiin/reactive-proxy-state 1.0.27 → 1.0.29
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 +8 -0
- package/dist/deep-to-raw.d.ts +5 -0
- package/dist/index.cjs +2583 -69
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2586 -69
- package/dist/integrations/vue3.d.ts +5 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -80,6 +80,14 @@ onServerEvent((event) => {
|
|
|
80
80
|
serverState.count = 5; // Automatically synced to all clients
|
|
81
81
|
```
|
|
82
82
|
|
|
83
|
+
If you need to relay state or events through `postMessage`, workers, or any structured-clone boundary, convert them first:
|
|
84
|
+
|
|
85
|
+
```typescript
|
|
86
|
+
import { deepToRaw } from "@yiin/reactive-proxy-state";
|
|
87
|
+
|
|
88
|
+
worker.postMessage(deepToRaw(serverState));
|
|
89
|
+
```
|
|
90
|
+
|
|
83
91
|
See the [`updateState` documentation](./docs/api/update-state.md) and [`reactive` documentation](./docs/api/reactive.md) for more details on event emission and application.
|
|
84
92
|
|
|
85
93
|
## API
|