-
Notifications
You must be signed in to change notification settings - Fork 187
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
Added listen methods to presence channels and interface - prevent Angular build errors #241
Conversation
If it's most likely not the correct solution let's not do it. 😬 |
I need to be able to reproduce the issue first. Please provide a repo that reproduces it. |
@Mathem8tic ah just saw in the issue that you did. I'll try to have a look soon. |
@Mathem8tic Why don't you consider this to be the right solution? |
I think it might be correct. I just assumed those methods were left out
for a reason that I was unaware of. I can confirm that the solution works
nicely for my Angular project.
Feel free to pull it in if you are satisfied with the additions.
Take care.
|
Okay, re-opening then. |
Can someone let me know what issue we are attempting to fix? |
This doesn't maky any sense. Pusher presence channel ALREADY extends PusherChannel which already has a |
Understood @taylorotwell, thanks for getting to this. I will wait and see what @driesvints thinks is the best solution based on the reproduction of #239. |
I really don't know sorry. I can reproduce this but I have too limited knowledge of typescript or javascript to know what the best solution is. |
@driesvints No problem. I'll just continue to use my adjustment for my use case. Hopefully someone brighter then myself offers up the ideal solution down the road. Take care. |
@Mathem8tic @taylorotwell @driesvints @sebastiandedeyne @ellisio Here is my solution and hope it can help you. Thank you. |
So I found that there isn't a bug or an issue with the interface at all with the PresenceChannel. Just assign as the type for your LaravelEchoChannel ng-cli wont throw any errors. private echo: Echo;
private LaravelEchoChannel: any;
LaravelEchoChannel = echo.join(channel)
.here((users: any) => {
log.debug('[Presence][Channel]', users);
})
.joining((user: any) => {
log.debug('joining', user.name);
})
.leaving((user: any) => {
log.debug('leaving', user.name);
});
LaravelEchoChannel
.listen('.event', (event: string) => {
log.debug('event');
}); This seems more of a ng-cli ts config issue. |
@driesvints this is most likely not the correct solution, but it does prevent the errors which are stopping the build from succeeding when using Angular CLI. You will see I just added the listen method to the various PresenceChannels.
I hope this helps!