Skip to content

Instantly share code, notes, and snippets.

@iskenxan
Created April 21, 2019 17:41
Show Gist options
  • Save iskenxan/73ff8acd619515cf740d3cd692cef7df to your computer and use it in GitHub Desktop.
Save iskenxan/73ff8acd619515cf740d3cd692cef7df to your computer and use it in GitHub Desktop.
const ReceiptManager = require('./receipt-manager');
const {
EmailStrategy,
SlackStrategy,
} = require('./strategy');
function main(orderId, userEmail) {
const manager = new ReceiptManager();
const email = new EmailStrategy();
manager.sendReceipt(orderId, userEmail, email);
const slack = new SlackStrategy();
manager.sendReceipt(orderId, userEmail, slack);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment