From 0b234d72cd35707689da8d3123ec90a2e4e1c70e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rom=C3=A1n=20Coiti=C3=B1o?= Date: Tue, 5 Oct 2021 23:31:27 -0300 Subject: [PATCH] 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 --- guides/source/action_cable_overview.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/guides/source/action_cable_overview.md b/guides/source/action_cable_overview.md index 129b9fb110..cdc024db94 100644 --- a/guides/source/action_cable_overview.md +++ b/guides/source/action_cable_overview.md @@ -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"] }) } }) ```