Skip to content

Instantly share code, notes, and snippets.

@neilmanuell
Created July 21, 2012 21:11
Show Gist options
  • Save neilmanuell/3157202 to your computer and use it in GitHub Desktop.
Save neilmanuell/3157202 to your computer and use it in GitHub Desktop.
Mapping separate commands with Guards and Hooks to same Event type
commandmap
.map( Event.COMPLETE, Event )
.toCommand( DispatchProcessEvent )
.withHooks( InjectMakeAbsoluteProcess )
.withGuards( OnlyIfReasonNotAbsolute );
commandmap
.map( Event.COMPLETE, Event )
.toCommand( DispatchProcessEvent )
.withHooks( InjectMakeEvenProcess )
.withGuards( OnlyIfReasonNotEven );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment