You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To call client-side functions from the server, use `ctx.rpc.boardcast()` (note: the method name is `boardcast`, which broadcasts to all connected clients):
377
+
To call client-side functions from the server, use `ctx.rpc.broadcast()` (note: the method name is `broadcast`, which broadcasts to all connected clients):
378
378
379
379
```ts {6-10}
380
380
exportdefaultfunction myPlugin():Plugin {
@@ -383,7 +383,7 @@ export default function myPlugin(): Plugin {
383
383
devtools: {
384
384
setup(ctx) {
385
385
// Broadcast to all connected clients
386
-
ctx.rpc.boardcast('my-plugin:client-update', {
386
+
ctx.rpc.broadcast('my-plugin:client-update', {
387
387
message: 'Hello from server!'
388
388
})
389
389
},
@@ -392,7 +392,7 @@ export default function myPlugin(): Plugin {
392
392
}
393
393
```
394
394
395
-
The `boardcast` method returns a promise that resolves to an array of results from all clients (some may be `undefined` if the client doesn't implement the function).
395
+
The `broadcast` method returns a promise that resolves to an array of results from all clients (some may be `undefined` if the client doesn't implement the function).
396
396
397
397
**Example: Broadcasting dock updates**
398
398
@@ -401,7 +401,7 @@ Here's a real-world example of how the built-in docks system broadcasts updates:
401
401
```ts
402
402
// When a dock entry is updated, broadcast to all clients
0 commit comments