mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
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
This commit is contained in:
parent
fb1ab3460a
commit
0b234d72cd
1 changed files with 2 additions and 2 deletions
|
@ -585,7 +585,7 @@ consumer.subscriptions.create("AppearanceChannel", {
|
|||
},
|
||||
|
||||
get documentIsActive() {
|
||||
return document.visibilityState == "visible" && document.hasFocus()
|
||||
return document.visibilityState === "visible" && document.hasFocus()
|
||||
},
|
||||
|
||||
get appearingOn() {
|
||||
|
@ -653,7 +653,7 @@ import consumer from "./consumer"
|
|||
|
||||
consumer.subscriptions.create("WebNotificationsChannel", {
|
||||
received(data) {
|
||||
new Notification(data["title"], body: data["body"])
|
||||
new Notification(data["title"], { body: data["body"] })
|
||||
}
|
||||
})
|
||||
```
|
||||
|
|
Loading…
Reference in a new issue