bryanhitc / lcu-sharp

An API wrapper for the League of Legends client.
MIT License
44 stars 10 forks source link

Add an event for when LeagueClientApi has connected #12

Closed ghost closed 5 years ago

ghost commented 5 years ago

Using an event handler for subscribing to an event after the LeagueClientAPI has connected in my project. I figured this could be useful.

bryanhitc commented 5 years ago

Hmm, I was thinking about doing this, but admittedly, I see very little reason to. Both LeagueClientApi.ConnectAsync() and ILeagueClientApi.ReconnectAsync() won't yield a result until a connection is established, so adding a event EventHandler Connected seems a bit redundant to me.

However, if you think the current paradigm of waiting for a Task to complete isn't desirable (which is totally valid, by the way, and I've been thinking about this myself), then perhaps a Connected event would be desirable depending on the proposed changes.

I'd love to hear what you think.

ghost commented 5 years ago

Yeah, you're completely right about the redundancy. I overlooked that executing anything after an awaited ConnectAsync() will achieve the same result.