Advertisement
Guest User

Untitled

a guest
Sep 27th, 2016
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. import { Kettle, Cup, Tea, Honey } from '@kitchen/cupboard';
  2. import { TapWater } from '@kitchen/sink';
  3. import { Consume, Smile, Feel } from '@life/actions';
  4.  
  5. //...
  6.  
  7. @Input private flavor: String = “Japanese mountain tea”;
  8.  
  9. ngOnInit() {
  10.  
  11. const favoriteTea: <Tea> = this.flavor ? this.flavor : "Chamomile tea";
  12.  
  13. this.boil(TapWater, w => {
  14. this.brew((w, favoriteTea, Honey), brew => {
  15.  
  16. // Start enjoying
  17. Consume(brew).then(() => {
  18. Smile().then(() => {
  19. Feel.better();
  20. });
  21. });
  22.  
  23. });
  24. });
  25. };
  26.  
  27. public boil(water: Liquid, callback): Liquid {
  28. Kettle.heat(
  29. setTimeout(() => {
  30. callback(water);
  31. }, 120000);
  32. );
  33. }
  34.  
  35. public brew(water: Liquid, tea: Herb, honey: any, callback) {
  36. setTimeout(() => {
  37. callback({
  38. water: water,
  39. tea: tea,
  40. honey: honey
  41. });
  42. }, 60000);
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement