Event Driven Applications - 401-advanced-javascript-Mai/amman-javascript-401d1 GitHub Wiki

Event-Driven Programming

most actions in javascript are an event-driven example: express route.

Emitting Events

-did something important and tell Other about it. -something happens and I must take care of it >>> the example shows that each time delete happen just send me a massage

events.on('delete', (data) => { sendEmail({ to: '[email protected]', subject: 'Someone deleted part of the database', body: Record id: ${data} was removed`` }); `});`