Last active
September 5, 2022 19:54
-
-
Save michalkorzawski/044f2c00f5fe732fbec1f6f21d1fa065 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // app/javascript/channels/user_channel.js | |
| import consumer from "./consumer"; | |
| import CableReady from "cable_ready"; | |
| consumer.subscriptions.create("UserChannel", { | |
| received(data) { | |
| if (data.cableReady) CableReady.perform(data.operations); | |
| // Called when there's incoming data on the websocket for this channel | |
| }, | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment