aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source/action_cable_overview.md
diff options
context:
space:
mode:
authorJavan Makhmali <javan@javan.us>2019-01-16 14:09:10 -0500
committerJavan Makhmali <javan@javan.us>2019-01-16 16:15:43 -0500
commit385d31d209a957946378307e50aa739ccfadfea1 (patch)
tree11631db8b66c8d7d272dda11c715aeb253eb2ecc /guides/source/action_cable_overview.md
parent90536ebfb3f0ca6971bc3ea4e43f20b8e977539b (diff)
downloadrails-385d31d209a957946378307e50aa739ccfadfea1.tar.gz
rails-385d31d209a957946378307e50aa739ccfadfea1.tar.bz2
rails-385d31d209a957946378307e50aa739ccfadfea1.zip
Minimize boilerplate setup code for JavaScript libraries
Diffstat (limited to 'guides/source/action_cable_overview.md')
-rw-r--r--guides/source/action_cable_overview.md4
1 files changed, 2 insertions, 2 deletions
diff --git a/guides/source/action_cable_overview.md b/guides/source/action_cable_overview.md
index df02d5bd91..8f5c44849a 100644
--- a/guides/source/action_cable_overview.md
+++ b/guides/source/action_cable_overview.md
@@ -181,9 +181,9 @@ established using the following JavaScript, which is generated by default by Rai
// Action Cable provides the framework to deal with WebSockets in Rails.
// You can generate new channels where WebSocket features live using the `rails generate channel` command.
-import ActionCable from "@rails/actioncable"
+import { createConsumer } from "@rails/actioncable"
-export default ActionCable.createConsumer()
+export default createConsumer()
```
This will ready a consumer that'll connect against `/cable` on your server by default.