-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Milestone
Description
In the current implementation, all events are dispatched to OnMessage. This means you'd have to use your own conditional logic like a switch statement to direct traffic like:
public void OnMessage(ServerSentEvent ev)
{
switch (ev.Event)
{
case "my-event":
// ...
break;
default:
// ...
break;
}
}
The proposal here is to add a CustomEvents dictionary to the client. If a key exists for the event type in the dictionary, it will be dispatched to that handler and not OnMessage. If no handler exists in the dictionary, OnMessage would be invoked.