-
Notifications
You must be signed in to change notification settings - Fork 25
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
How to trigger an event ? #13
Comments
@hamxabaig I don't think (correct me if I am wrong) that Pusher supports triggering events at all on client side, only on server, otherwise all your private keys would be exposed. |
@TheRusskiy mmm, It supports check this out |
All we need is channel object returned by subscribe. |
@hamxabaig I also needed to trigger client events so just sent a pull request that would allow it. It would work as follows... import { getChannel } from 'pusher-redux'
// gets the channel object from the client
var myChannel = getChannel('my-channel-name');
// trigger an event with your args
myChannel.trigger(...); |
@adbalits thats cool, Yes it does make sense for a feature like this 🎉 |
@adbalits thanks again for taking your time to do the pull request. |
@TheRusskiy one more thing is, I've a use case where i need to execute a function after i get the event from pusher-redux. We can do this easily with redux as pusher-redux/lib/pusher-redux.js Line 109 in 1eed6bd
Right now i've forked the repo and added a callback function to the params of subscribe and then using it in the dispatch(..).then(cb)
Do you have some alternative solution to it? |
@hamxabaig |
@TheRusskiy you understood correctly, I found a way to get this done. Can you release the feature |
Hey there, I checked the documentation, seems there is no way i can trigger an event or get the pusher channel so i can trigger events on my own. Is there any way ? Or its not supported at all
The text was updated successfully, but these errors were encountered: