Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement