File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
src/pages/[platform]/build-a-backend/data/connect-event-api Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -83,6 +83,10 @@ export default function App() {
83
83
84
84
async function publishEvent() {
85
85
await events .post (' default/channel' , { some: ' data' });
86
+
87
+ // Alternative way to publish events through the channel
88
+ const channel = await events .connect (' default/channel' );
89
+ await channel .publish ({ some: ' data' });
86
90
}
87
91
88
92
return (
@@ -241,6 +245,10 @@ export default function App() {
241
245
242
246
async function publishEvent() {
243
247
await events .post (' default/channel' , { some: ' data' });
248
+
249
+ // Alternative way to publish events through the channel
250
+ const channel = await events .connect (' default/channel' );
251
+ await channel .publish ({ some: ' data' });
244
252
}
245
253
246
254
return (
You can’t perform that action at this time.
0 commit comments