-
Notifications
You must be signed in to change notification settings - Fork 21.9k
Action Cable: client side 💅 #24039
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Action Cable: client side 💅 #24039
Conversation
#getConfig was implmented as general utility for reading action-cable-* meta tags (hence the `name` argument). Introduced in 8b69f1e.
r? @senny (@rails-bot has picked a reviewer for you, use r? to override) |
@identifier = JSON.stringify(params) | ||
extend(this, mixin) | ||
@subscriptions.add(this) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is this logic performed elsewhere, I think we still want to do this? Could be missing something -- not super familiar with CoffeeScript :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved it to Subscriptions#create
(see ~13 lines down in this PR). Before, Subscriptions#create
constructed Subscription
instances with a reference to @subscriptions
and the subscription would then add itself to the collection. I'm not sure why I implemented that way originally. Now, Subscriptions#create
makes a Subscription
and then adds it to its collection.
In short: same end result, less confusing circular object passing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh, gotcha. 👍 for less circular logic. :)
In general, 👍 for refactoring this a bit. |
❤️ |
ActionCable::INTERNAL
to ensure it stays synced withaction_cable.js
(viaaction_cable.coffee.erb
)ActionCable#getConfig
to its original, intended design for reading anyaction-cable-*
meta tag/cc @maclover7, @jeremy