Skip to content

Instantly share code, notes, and snippets.

@dcantu476
Last active February 3, 2020 19:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dcantu476/c01f1eefa759dfd83436638875a7603d to your computer and use it in GitHub Desktop.
Save dcantu476/c01f1eefa759dfd83436638875a7603d to your computer and use it in GitHub Desktop.
Pizza Shop
const pizzaChef = pizzaCookingSubject.subscribe((event: string) => {
// Tell chef a step is complete so he can start the next step.
if (employeeIsClockedIn && employeeIsResponsibleForTask) {
notifyTheEmployeesOfTheStatus(event);
}
})
const pizzaCustomer = pizzaCustomer.subscribe((event: string) => {
// Tell the customer a status update.
if (userAllowsNotifications) {
notifyTheCustomerOfTheStatus(event);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment