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

Create a Plugin manager #4

Open
adierkens opened this issue Dec 6, 2022 · 0 comments
Open

Create a Plugin manager #4

adierkens opened this issue Dec 6, 2022 · 0 comments

Comments

@adierkens
Copy link
Owner

Often times with the tapable interface used projects, they are paired with a set of plugins.

By default we typically just construct a list of them, and apply() them onto the main entry to the library:

class MyThing {
  constructor(conf: { plugins: Array<Plugin> }) {
     conf.plugins.forEach(p => p.apply(this));
  }
}

This works fine for most use-cases, but as projects grow there are often needs for plugins to communicate with each other. It would be helpful to create a manager that handles all of the register, find, applyTo calls for a set of plugins and be able to reuse that across multiple projects.

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

1 participant