A library and framework for implmenting the cqrs pattern without a lot of boilerplate and over head.
Vscode snippets
These snippets will make your life easier! Add them to your user snippets and start hacking away!
Command:
This snippet will allow you to rapidly create a command, event and command handler
"command-handler":
Events:
This snippet will allow you to easily create an aggregated event type
"events":
How do I use it?
For simplicity sake, here is a mostly complete sample.
; ;CommandHandler"DoSillyThing", .withRulecolorMustBeValid ;EventHandler"SillyThingHappened", ;QueryHandler"FindSillyThingEvents", /////////// App /////////// // Commands // To load command handlers from directory: // loadHandlers({// directory: resolve(__dirname, "commands")// })app.post"/commands/:commandName", json, withCommands // Queries // To load query handlers from directory:// loadHandlers({// directory: resolve(__dirname, "queries")// })app.post"/queries/:queryName", json, withQueries // Events // To load event handlers from directory:// loadHandlers({// directory: resolve(__dirname, "events")// })withEvents // Start it up!app.listen3000,