
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
A support library for commands and handlers in existing or 'could be' CQRS systems.
Installation:
npm install --save mototaxi
Usage:
//We should have some command handlers...
const sopranoHandler = {
harmony: (command) => {
console.log(`Singing the soprano part of ${command.song}. La la la LA!`);
return { type: 'songFinished', name: command.song };
}
}
const altoHandler = {
harmony: (command) => {
console.log(`Singing the alto part of ${command.song}. La la LA la!`);
return { type: 'songFinished', name: command.song };
}
}
const tenorHandler = {
harmony: (command) => {
console.log(`Singing the tenor part of ${command.song}. La LA la la!`);
return { type: 'songFinished', name: command.song };
}
}
const bassHandler = {
harmony: (command) => {
console.log(`Singing the bass part of ${command.song}. LA la la la!`);
return { type: 'songFinished', name: command.song };
}
}
const soloHandler = {
solo: (command) => {
console.log(`Singing the big solo. Laaaaaa laaaa la la!`);
return { name: command.song };
}
}
//Need to get a dispatcher, preloaded with all the command handlers...
const motoTaxi = require('mototaxi');
const commandHandlers = [ sopranoHandler, altoHandler, tenorHandler, bassHandler, soloHandler ];
const dispatcher = mototaxi.getDispatcher(commandHandlers);
//Now, we can dispatch commands without caring what handlers might or might not handle them!
dispatcher
.dispatch({ type: 'solo' })
.subscribe((s) => { console.log(s.name); });
dispatcher
.dispatch({ type: 'harmony', song: 'Free Bird' })
.filter((e) => e.type==='songFinished')
.subscribe((s) => { console.log(s.name); });
dispatcher
.dispatch({ type: 'solo' })
.subscribe((s) => { console.log(s.name); });
FAQs
A support library for commands and handlers in existing or 'could be' CQRS systems.
The npm package mototaxi receives a total of 16 weekly downloads. As such, mototaxi popularity was classified as not popular.
We found that mototaxi demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.