Skip to content

Instantly share code, notes, and snippets.

@emolr
Created September 27, 2016 06:42
Show Gist options
  • Select an option

  • Save emolr/14f2766dc653ef8e50f52266f5607763 to your computer and use it in GitHub Desktop.

Select an option

Save emolr/14f2766dc653ef8e50f52266f5607763 to your computer and use it in GitHub Desktop.
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