@liveblocks/zustand 0.15.9 → 0.15.11
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 +14 -4
- package/lib/index.d.ts +3 -3
- package/package.json +6 -3
package/README.md
CHANGED
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
<p align="center">
|
|
2
2
|
<a href="https://liveblocks.io">
|
|
3
|
-
<img src="https://
|
|
3
|
+
<img src="https://raw.githubusercontent.com/liveblocks/liveblocks/main/.github/assets/header.svg" alt="Liveblocks" />
|
|
4
4
|
</a>
|
|
5
5
|
</p>
|
|
6
6
|
|
|
7
|
-
#
|
|
7
|
+
# `@liveblocks/zustand`
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
<p>
|
|
10
|
+
<a href="https://npmjs.org/package/@liveblocks/zustand">
|
|
11
|
+
<img src="https://img.shields.io/npm/v/@liveblocks/zustand?style=flat&label=npm&color=c33" alt="NPM" />
|
|
12
|
+
</a>
|
|
13
|
+
<a href="https://bundlephobia.com/package/@liveblocks/zustand">
|
|
14
|
+
<img src="https://img.shields.io/bundlephobia/minzip/@liveblocks/zustand?style=flat&label=size&color=09f" alt="Size" />
|
|
15
|
+
</a>
|
|
16
|
+
<a href="https://github.com/liveblocks/liveblocks/blob/main/LICENSE">
|
|
17
|
+
<img src="https://img.shields.io/github/license/liveblocks/liveblocks?style=flat&label=license&color=f80" alt="License" />
|
|
18
|
+
</a>
|
|
19
|
+
</p>
|
|
10
20
|
|
|
11
21
|
## Installation
|
|
12
22
|
|
|
@@ -16,7 +26,7 @@ npm install @liveblocks/client @liveblocks/zustand
|
|
|
16
26
|
|
|
17
27
|
## Documentation
|
|
18
28
|
|
|
19
|
-
- Start with the [React
|
|
29
|
+
- Start with the [React and Zustand guide](https://liveblocks.io/docs/get-started/react-zustand).
|
|
20
30
|
- Explore the [API Reference](https://liveblocks.io/docs/api-reference/liveblocks-zustand).
|
|
21
31
|
|
|
22
32
|
## Examples
|
package/lib/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { StateCreator, SetState, GetState, StoreApi } from "zustand";
|
|
2
|
-
import { Client,
|
|
3
|
-
export declare type LiveblocksState<TState, TPresence =
|
|
2
|
+
import { Client, Presence, Room, User } from "@liveblocks/client";
|
|
3
|
+
export declare type LiveblocksState<TState, TPresence extends Presence = Presence> = TState & {
|
|
4
4
|
/**
|
|
5
5
|
* Liveblocks extra state attached by the middleware
|
|
6
6
|
*/
|
|
@@ -51,5 +51,5 @@ declare type Options<T> = {
|
|
|
51
51
|
*/
|
|
52
52
|
presenceMapping?: Mapping<T>;
|
|
53
53
|
};
|
|
54
|
-
export declare function middleware<T extends
|
|
54
|
+
export declare function middleware<T extends Record<string, unknown>, TPresence extends Record<string, unknown> = Presence>(config: StateCreator<T, SetState<T>, GetState<LiveblocksState<T>>, StoreApi<T>>, options: Options<T>): StateCreator<LiveblocksState<T, TPresence>, SetState<LiveblocksState<T, TPresence>>, GetState<LiveblocksState<T, TPresence>>, StoreApi<LiveblocksState<T, TPresence>>>;
|
|
55
55
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@liveblocks/zustand",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.11",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"directory": "packages/liveblocks-zustand"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
|
-
"@liveblocks/client": "0.15.
|
|
39
|
+
"@liveblocks/client": "0.15.11",
|
|
40
40
|
"zustand": "^3"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
@@ -51,7 +51,10 @@
|
|
|
51
51
|
"@testing-library/react": "^12.1.2",
|
|
52
52
|
"@testing-library/react-hooks": "^7.0.2",
|
|
53
53
|
"@types/jest": "^27.4.0",
|
|
54
|
+
"@typescript-eslint/eslint-plugin": "^5.18.0",
|
|
55
|
+
"@typescript-eslint/parser": "^5.18.0",
|
|
54
56
|
"esbuild": "0.14.11",
|
|
57
|
+
"eslint": "^8.12.0",
|
|
55
58
|
"jest": "^27.4.7",
|
|
56
59
|
"msw": "^0.36.4",
|
|
57
60
|
"rollup": "^2.64.0",
|
|
@@ -59,4 +62,4 @@
|
|
|
59
62
|
"whatwg-fetch": "^3.6.2",
|
|
60
63
|
"zustand": "^3.6.9"
|
|
61
64
|
}
|
|
62
|
-
}
|
|
65
|
+
}
|