We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi,
I was wondering how to implement some kind of singleton subscription. Example:
$('body').delegate '#new_participation a', 'ajax:success', (event, data)-> channel = "games/#{data.game.id}/joins" juggernaut.subscribe channel, (data)-> console.log "Data received...", data
The problem : after each event, a new subscribtion is created and the log is called many times. To fix it:
$('body').delegate '#new_participation a', 'ajax:success', (event, data)-> channel = "games/#{data.game.id}/joins" unless subscriptions[channel] subscriptions[channel] = true juggernaut.subscribe channel, (data)-> console.log "Data received...", data else console.log "Already subscribed!"
I believe this need is really common so, do you mind if I send a pull request to add it at the library level?
Romain
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi,
I was wondering how to implement some kind of singleton subscription. Example:
The problem : after each event, a new subscribtion is created and the log is called many times. To fix it:
I believe this need is really common so, do you mind if I send a pull request to add it at the library level?
Romain
The text was updated successfully, but these errors were encountered: