Files
probot/lib/plugins/base.js
2016-11-17 13:26:58 -08:00

26 lines
504 B
JavaScript

class MixinBuilder {
constructor(superclass) {
this.superclass = superclass;
}
with(...mixins) {
return mixins.reduce((c, mixin) => mixin(c), this.superclass);
}
}
const mix = superclass => new MixinBuilder(superclass);
class EvaluatorBase {
// Public function to either pass the string through or lookup network data
resolveData(data, fn) {
// TODO make a network to fetch the data
fn(data);
return this;
}
}
module.exports = {
mix,
Evaluator: EvaluatorBase
};