Created
November 29, 2017 19:46
-
-
Save esparkman/c4e6b96d51e7e7a729674a8c7b492afa to your computer and use it in GitHub Desktop.
This file contains 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.products = App.cable.subscriptions.create("ProductsChannel", { | |
connected: function() { | |
// Called when the subscription is ready for use on the server | |
}, | |
disconnected: function() { | |
// Called when the subscription has been terminated by the server | |
}, | |
received: function(data) { | |
// Called when there's incoming data on the websocket for this channel | |
document.getElementsByTagName("main")[0].innerHTML = data.html | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment