Skip to content

Instantly share code, notes, and snippets.

@wullemsb
Last active April 21, 2024 18:34
const handleUserCommands = (command: UserCommand) => {
switch (command.type) {
case 'createUser':
createUser(command.name, command.email);
break;
case 'deleteUser':
deleteUser(command.userId);
break;
default:
throw Error('Invalid command type');
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment