-
Notifications
You must be signed in to change notification settings - Fork 8
EventName
Mitch Ferrer edited this page Mar 5, 2015
·
1 revision
The event name is at the core of how the framework works. The underlying value is a unique string that maps to an Enum in C# and a const string in TypeScript. It enforces two conventions:
- Your Enum should have a name ending with Events.
- The unique string created for the event is a combination of the category of the event, and the specific name.
public enum UserEvents
{
SearchRequest,
SearchRespones,
DeleteRequest,
DeleteResponse,
}
If we were to use UserEvents.SearchRequest
as an example it would translate to "UserSearchRequest"
. These two conventions ensure that if we can create the enum and member it should be unique in our app.
You will find this type as a param on the handler registry. It is worth noting that using an implicit operator, we have removed the need to create an new EventName<UserEvents>(UserEvents.SearchRequest)
just to pass it to the function.