@gwakko/shared-websocket 0.6.1 → 0.6.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.
Files changed (2) hide show
  1. package/README.md +34 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -2,6 +2,40 @@
2
2
 
3
3
  Share ONE WebSocket connection across multiple browser tabs. Zero dependencies. React and Vue adapters included.
4
4
 
5
+ ## Table of Contents
6
+
7
+ - [Problem](#problem)
8
+ - [Solution](#solution)
9
+ - [Installation](#installation)
10
+ - [Usage — Vanilla TypeScript](#usage--vanilla-typescript)
11
+ - [Scoped Lifecycle — withSocket()](#scoped-lifecycle--withsocket)
12
+ - [Usage — React](#usage--react)
13
+ - [Usage — Vue 3](#usage--vue-3)
14
+ - [API Reference](#api-reference)
15
+ - [Options](#options)
16
+ - [Authentication](#authentication)
17
+ - [React Hooks](#react-hooks-react-19-useeffectevent-for-stable-refs)
18
+ - [Vue Composables](#vue-composables)
19
+ - [How It Works](#how-it-works)
20
+ - [When to Use `useWorker: true`](#when-to-use-useworker-true)
21
+ - [Typed Events](#typed-events)
22
+ - [Type narrowing](#type-narrowing-for-untyped-events)
23
+ - [Runtime validation with Zod](#runtime-validation-with-zod)
24
+ - [Middleware](#middleware)
25
+ - [Debug Mode & Custom Logger](#debug-mode--custom-logger)
26
+ - [Custom Event Protocol](#custom-event-protocol)
27
+ - [Advanced Examples](#advanced-examples)
28
+ - [Stream](#stream--consume-events-as-async-iterator)
29
+ - [Request](#request--requestresponse-through-server)
30
+ - [Protocols](#protocols--websocket-subprotocols)
31
+ - [Worker URL](#worker-url--custom-worker-file)
32
+ - [Lifecycle Hooks](#lifecycle-hooks)
33
+ - [Private Channels](#private-channels--chat-rooms-tenant-notifications)
34
+ - [Server-side channel handling](#server-side-channel-handling)
35
+ - [Exported Types](#exported-types)
36
+ - [Browser Support](#browser-support)
37
+ - [License](#license)
38
+
5
39
  ## Problem
6
40
 
7
41
  5 tabs open = 5 WebSocket connections = 5x server resources for the same user.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gwakko/shared-websocket",
3
- "version": "0.6.1",
3
+ "version": "0.6.2",
4
4
  "description": "Share ONE WebSocket connection across browser tabs — leader election, BroadcastChannel sync, optional Web Worker",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",