Skip to content

Instantly share code, notes, and snippets.

@UsamaAshraf
Created November 3, 2018 16:01
Show Gist options
  • Save UsamaAshraf/fed128977a4e3d232fdee4628405cb0b to your computer and use it in GitHub Desktop.
Save UsamaAshraf/fed128977a4e3d232fdee4628405cb0b to your computer and use it in GitHub Desktop.
const myEmitter = require('./my_emitter');
// Perform the registration steps
// The application should react differently if the new user has been activated instantly.
if (user.activated) {
myEmitter.emit('user-registered:activated', user);
} else {
myEmitter.emit('user-registered', user);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment