From 05679c6a29aa34ceba9e9bfc1dff5a050d9d794d Mon Sep 17 00:00:00 2001 From: Vladimir Dementyev Date: Wed, 9 Oct 2024 14:57:32 -0700 Subject: [PATCH] - upd client-side turbo snippet --- docs/guides/client-side.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/docs/guides/client-side.md b/docs/guides/client-side.md index 3cc5e12..1cb4e33 100644 --- a/docs/guides/client-side.md +++ b/docs/guides/client-side.md @@ -186,11 +186,12 @@ For that, you must install the [`@anycable/turbo-stream` package](https://github Here is how to switch `@hotwired/turbo` to use AnyCable client: -```diff -- import "@hotwired/turbo-rails"; -+ import "@hotwired/turbo"; -+ import { start } from "@anycable/turbo-stream"; -+ import cable from "cable" -+ -+ start(cable, { delayedUnsubscribe: true }) +```js +// IMPORTANT: Do not import turbo-rails, just turbo +// import "@hotwired/turbo-rails"; +import "@hotwired/turbo"; +import { start } from "@anycable/turbo-stream"; +import cable from "cable" + +start(cable, { delayedUnsubscribe: true }) ```