Skip to content

Commit

Permalink
- upd client-side turbo snippet
Browse files Browse the repository at this point in the history
  • Loading branch information
palkan committed Oct 9, 2024
1 parent 6307ead commit 05679c6
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions docs/guides/client-side.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 })
```

0 comments on commit 05679c6

Please sign in to comment.