Support for plugins
Opened this issue · 3 comments
Proposing adding support for a function that will allow a plugin to add/override methods without having to use a long extends chain.
It could look something like this:
ajax.js
export default class Ajax {
get(url, data) {
//...
}
post(url, data) {
//...
}
}
app.js
import Ajax from './Plugins/ajax.js';
Domodule.registerPlugin(Ajax);
Not sure how we'd handle constructors though.
You think this would be helpful?
I've read that before and in the case of react and other huge frameworks it makes a lot of sense. For us though I think something more along the lines of http://matthijshollemans.com/2015/07/22/mixins-and-traits-in-swift-2/ makes more sense (implemented something like https://gist.github.com/lukescott/36453a75c39c539f5c7d at least until es7).
This would also allow us to break up the core class, something we can't really do right now.
cool, I'll go through these