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

way to control pre-loaded instance plugins #6

Open
jonschlinkert opened this issue Dec 6, 2015 · 4 comments
Open

way to control pre-loaded instance plugins #6

jonschlinkert opened this issue Dec 6, 2015 · 4 comments
Labels

Comments

@jonschlinkert
Copy link
Member

Pre-loaded plugins are called before other potentially necessary properties are set on the instance (by inheriting applications or even other non-pre-loaded instance plugins).

We might need implement some type of control over when to invoke pre-loaded plugins. Or even just allow them to be loaded, but not invoked, so that an inheriting application can do .run on the instance to call the plugins.

@doowb thoughts?

@doowb
Copy link
Member

doowb commented Dec 7, 2015

I think we can make .run run the pre-loaded plugins against the current instance if no arguments are passed in. This will require users to do:

var app = new Base();
app.run();

I think this is okay because even with the instance .use method, if you want to run those plugins against something else, you have to manually call .run(something).

For inheriting classes this allows doing:

function MyApp() {
  Base.call(this);

  // add something else here
  this.use(something());

  // run any class prototype plugins
  this.run();
}

@tunnckoCore
Copy link
Contributor

@jonschlinkert can you clarify a bit? I can't get it enough currently.

@jonschlinkert
Copy link
Member Author

What specifically are you having trouble with? can you give an example?

@tunnckoCore
Copy link
Contributor

dont have trouble, just trying to understand more clearly for what the issue for.

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

No branches or pull requests

3 participants