Created
September 27, 2016 06:42
-
-
Save emolr/14f2766dc653ef8e50f52266f5607763 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Kettle, Cup, Tea, Honey } from '@kitchen/cupboard'; | |
| import { TapWater } from '@kitchen/sink'; | |
| import { Consume, Smile, Feel } from '@life/actions'; | |
| //... | |
| @Input private flavor: String = “Japanese mountain tea”; | |
| ngOnInit() { | |
| const favoriteTea: <Tea> = this.flavor ? this.flavor : "Chamomile tea"; | |
| this.boil(TapWater, w => { | |
| this.brew((w, favoriteTea, Honey), brew => { | |
| // Start enjoying | |
| Consume(brew).then(() => { | |
| Smile().then(() => { | |
| Feel.better(); | |
| }); | |
| }); | |
| }); | |
| }); | |
| }; | |
| public boil(water: Liquid, callback): Liquid { | |
| Kettle.heat( | |
| setTimeout(() => { | |
| callback(water); | |
| }, 120000); | |
| ); | |
| } | |
| public brew(water: Liquid, tea: Herb, honey: any, callback) { | |
| setTimeout(() => { | |
| callback({ | |
| water: water, | |
| tea: tea, | |
| honey: honey | |
| }); | |
| }, 60000); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment