Expose Dish (SyncDish) in API and make it composable.

This commit is contained in:
d98762625 2018-08-23 21:40:45 +01:00
parent f73452e01f
commit f6c4b5073c
6 changed files with 66 additions and 13 deletions

View file

@ -18,13 +18,13 @@ import * as ops from "./index";
class SyncDish extends Dish {
/** */
constructor(dish=null) {
super(dish);
constructor(inputOrDish=null, type=null) {
super(inputOrDish);
// Add operations to make it composable
for (const op in ops) {
this[op] = () => ops[op](this.value);
}
}
/**