Subscribe on changes!

Support inject in app install

avatar
Sep 23rd 2020

What problem does this feature solve?

We want to use inject in app install for recursive dependence.

What does the proposed API look like?

export default {
  install (app: App, ...options: any[]) {
    app.provide('some_token', SomeService(app.inject('another_token')));
  }
}
avatar
Sep 23rd 2020

You can inject via install options.

avatar
Sep 24th 2020

How? Would you please show me the code?

avatar
Sep 24th 2020

app.use(Plugin, Injectables) where Injectables is an object containing all your dependencies.