zocket 0.0.1 → 0.0.2
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 +4 -4
- package/dist/bun.js +19 -3118
- package/dist/index.js +1 -3052
- package/dist/web.js +5 -3105
- package/package.json +5 -4
package/README.md
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
#
|
|
1
|
+
# zocket
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Zocket upgrades `orbz` Anchors into a hub-and-spoke network that communicates over WebSockets.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
The package uses hub-spoke assumptions to make synchronization tractable, while providing small environment adapters for hubs and spokes on runtimes like Bun and the browser.
|
|
6
6
|
|
|
7
7
|
## Bun hub persistence
|
|
8
8
|
|
|
9
9
|
`createHub()` accepts Orbz Anchor persistence options and passes them through when it creates the hub anchor. For a one-file JSON store:
|
|
10
10
|
|
|
11
11
|
```js
|
|
12
|
-
import { createHub, createJsonFilePersistence } from "
|
|
12
|
+
import { createHub, createJsonFilePersistence } from "zocket/bun"
|
|
13
13
|
|
|
14
14
|
const persist = createJsonFilePersistence(new URL("./hub-state.json", import.meta.url))
|
|
15
15
|
const hub = await createHub({ routes, shapes, persist })
|