Decorator: sending notifications

Add behaviour to a function by wrapping it in another function with the same signature.

Level Intermediate

What you will see

  1. One email, three extra jobs
  2. One function, one option per job
  3. A function that takes a notifier and returns one
  4. Before, after or around the call
  5. The order of the layers
  6. When not to use it

Before / after

Base: decorator-base-jsView the diff

Exercises