-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade @anycable/core and use it w/o Action Cable interface
- Loading branch information
Showing
7 changed files
with
37 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
import { createConsumer } from "@anycable/web"; | ||
import { createCable as create } from "@anycable/web"; | ||
|
||
let consumer; | ||
let instance; | ||
|
||
export const createCable = () => { | ||
if (!consumer) { | ||
consumer = createConsumer({ | ||
if (!instance) { | ||
instance = create({ | ||
protocol: "actioncable-v1-ext-json", | ||
}); | ||
} | ||
|
||
return consumer; | ||
return instance; | ||
}; | ||
|
||
export const createChannel = (...args) => { | ||
const consumer = createCable(); | ||
return consumer.subscriptions.create(...args); | ||
const cable = createCable(); | ||
return cable.subscribeTo(...args); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,19 +2,19 @@ | |
# yarn lockfile v1 | ||
|
||
|
||
"@anycable/core@^0.7.0": | ||
version "0.7.0" | ||
resolved "https://registry.yarnpkg.com/@anycable/core/-/core-0.7.0.tgz#8b607b35f82fe8ae996a279c6cc2dbb90e44161a" | ||
integrity sha512-S+hlxPapGq7PLN+wHPiBZbQP86nNkS6eFityXqcUCnIvXXumFCq3INUzzFhfZCYLmbwD3r6kbRTYwvJaw0P6WA== | ||
"@anycable/core@^0.8.0", "@anycable/core@^0.8.1": | ||
version "0.8.2" | ||
resolved "https://registry.yarnpkg.com/@anycable/core/-/core-0.8.2.tgz#518c964047b5b2650c527ea3baafab3b229c8882" | ||
integrity sha512-TKgqoLjDteH87jDQklejUGWaV3Ftcb3SRX2QKQXRvxX0oXDc21BiUDl01SAJFQz74BUgm7XMu+kvRrKceCA2sg== | ||
dependencies: | ||
nanoevents "^7.0.1" | ||
|
||
"@anycable/web@^0.7.0": | ||
version "0.7.0" | ||
resolved "https://registry.yarnpkg.com/@anycable/web/-/web-0.7.0.tgz#d74d3c546fc9807d236130e2f24d5928a9e8e394" | ||
integrity sha512-v/KESqA7DP8PY2WM9BDpPSB9/4OLdfPFipW4LDl9/5fkOOHIlcwL6so20BoxNQLE4gg3E/e6Ey8UtQgO2Aa2XA== | ||
"@anycable/web@^0.8.0": | ||
version "0.8.0" | ||
resolved "https://registry.yarnpkg.com/@anycable/web/-/web-0.8.0.tgz#923cd575a87194e4047b90ca56f234ba0f16c397" | ||
integrity sha512-w6yT0BGoLoaCzNrpT/Inj+AU2cRgWimEQq65t7tG6KBR9kLWyFLQzQ/FULyiExEUSEsWkEwSzYSyB2U/O5mgMw== | ||
dependencies: | ||
"@anycable/core" "^0.7.0" | ||
"@anycable/core" "^0.8.0" | ||
|
||
"@esbuild/[email protected]": | ||
version "0.17.5" | ||
|