Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for plugins #10

Open
dawnerd opened this issue Aug 4, 2016 · 3 comments
Open

Support for plugins #10

dawnerd opened this issue Aug 4, 2016 · 3 comments

Comments

@dawnerd
Copy link
Contributor

dawnerd commented Aug 4, 2016

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?

@jgallen23
Copy link
Member

@dawnerd
Copy link
Contributor Author

dawnerd commented Aug 4, 2016

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.

@jgallen23
Copy link
Member

cool, I'll go through these

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants