Skip to content
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

Closed
wants to merge 2 commits into from

Conversation

Mathem8tic
Copy link

@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!

@Mathem8tic Mathem8tic changed the title Added listen methods to presence channels and interface Added listen methods to presence channels and interface - prevent Angular build errors Aug 21, 2019
@taylorotwell
Copy link
Member

If it's most likely not the correct solution let's not do it. 😬

@driesvints
Copy link
Member

I need to be able to reproduce the issue first. Please provide a repo that reproduces it.

@driesvints
Copy link
Member

@Mathem8tic ah just saw in the issue that you did. I'll try to have a look soon.

@sebastiandedeyne
Copy link
Contributor

@Mathem8tic Why don't you consider this to be the right solution?

@Mathem8tic
Copy link
Author

Mathem8tic commented Aug 22, 2019 via email

@driesvints
Copy link
Member

Okay, re-opening then.

@driesvints driesvints reopened this Aug 22, 2019
@taylorotwell
Copy link
Member

Can someone let me know what issue we are attempting to fix?

@Mathem8tic
Copy link
Author

#239

@taylorotwell
Copy link
Member

This doesn't maky any sense. Pusher presence channel ALREADY extends PusherChannel which already has a listen method with an implementation. Surely overriding that with a new listen method which just does return this doesn't seem like the best idea and will break applications?

@Mathem8tic
Copy link
Author

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.

@driesvints
Copy link
Member

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.

@Mathem8tic
Copy link
Author

@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.

@dof-wmy
Copy link

dof-wmy commented Nov 6, 2019

@Mathem8tic @taylorotwell @driesvints @sebastiandedeyne @ellisio

Here is my solution and hope it can help you. Thank you.

#239 (comment)

@johnpaulmedina
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants