You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: events/index.md
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -62,3 +62,10 @@ require('events)
62
62
63
63
Main concept = listeners listen for events, that are emitted from emitters.
64
64
65
+
## Exercise
66
+
67
+
Image we are building a SaaS that does a number of things when a user creates an account. functionality that sends emails "confirmation" to a user when they create an account.
68
+
69
+
There is a mock emailer class in the folder that has a method `send`, which expects an email address and a message body as the parameters.
70
+
71
+
Use this to send a welcome email when a `userCreated` event is fired.
0 commit comments