I want to create a class which extends multiple classes.
class Scheduler extends mixin(EventEmitter, Mongo.Collection) {
// omit some stuff for brevity: below is sample function with emit.
add(id) {
check(id, String);
this.upsert({
count: { $lt: this.config.limit }
}, {
$addToSet: {
queue: id
},
$setOnInsert: {
queue: [],
count: 0
}
}, (err, result) => {
if (!err && result.insertedId) {
this.emit('cycle created', result.insertedId);
}
});
}
}
Is this possible with Meteor? It’s easy to do serverside, but I can’t find the right way to do it on both client and server