@hyperix/hooks 0.2.3 → 0.2.4

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 CHANGED
@@ -40,6 +40,23 @@ export function App() {
40
40
  }
41
41
  ```
42
42
 
43
+ ## Shared websocket client
44
+
45
+ When you need imperative websocket access outside React hooks, reuse the
46
+ package singleton instead of creating a second socket connection.
47
+
48
+ ```ts
49
+ import { wsClient, wsTransport } from "@hyperix/hooks";
50
+
51
+ const subscription = await wsClient.allMids((event) => {
52
+ console.log(event);
53
+ });
54
+
55
+ console.log(wsTransport.socket.readyState);
56
+
57
+ await subscription.unsubscribe();
58
+ ```
59
+
43
60
  ## Tests
44
61
 
45
62
  ```bash
package/dist/index.d.ts CHANGED
@@ -2,6 +2,7 @@ export * from "./use-all-mids.js";
2
2
  export * from "./use-all-perp-metas.js";
3
3
  export * from "./use-active-asset-data.js";
4
4
  export * from "./use-all-dexs-asset-ctxs.js";
5
+ export * from "./config/hl.js";
5
6
  export * from "./use-l2-book.js";
6
7
  export * from "./use-max-builder-fee.js";
7
8
  export * from "./use-mid.js";
package/dist/index.js CHANGED
@@ -2,6 +2,7 @@ export * from "./use-all-mids.js";
2
2
  export * from "./use-all-perp-metas.js";
3
3
  export * from "./use-active-asset-data.js";
4
4
  export * from "./use-all-dexs-asset-ctxs.js";
5
+ export * from "./config/hl.js";
5
6
  export * from "./use-l2-book.js";
6
7
  export * from "./use-max-builder-fee.js";
7
8
  export * from "./use-mid.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyperix/hooks",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",