Skip to content

Commit 0b234d7

Browse files
committed
Fix JS syntax on Action Cable Overview
Change two JavaScript examples in the Action Cable Overview guide to fix a couple of issues that seem to come from employing rubyisms: - a syntax error by using keyword arguments instead of a plain object - using == instead of === - this should be avoided if at all possible
1 parent fb1ab34 commit 0b234d7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

guides/source/action_cable_overview.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ consumer.subscriptions.create("AppearanceChannel", {
585585
},
586586

587587
get documentIsActive() {
588-
return document.visibilityState == "visible" && document.hasFocus()
588+
return document.visibilityState === "visible" && document.hasFocus()
589589
},
590590

591591
get appearingOn() {
@@ -653,7 +653,7 @@ import consumer from "./consumer"
653653

654654
consumer.subscriptions.create("WebNotificationsChannel", {
655655
received(data) {
656-
new Notification(data["title"], body: data["body"])
656+
new Notification(data["title"], { body: data["body"] })
657657
}
658658
})
659659
```

0 commit comments

Comments
 (0)