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

Allow for injectable services/transformations #4

Open
robbieaverill opened this issue Jun 4, 2019 · 0 comments
Open

Allow for injectable services/transformations #4

robbieaverill opened this issue Jun 4, 2019 · 0 comments

Comments

@robbieaverill
Copy link
Contributor

robbieaverill commented Jun 4, 2019

My situation:

I'd want to do this so that I can have Module A be abstract and provide some useful HOCs, while allowing Module B to pull in some of these influences.

I've tried registering WithMyOpinion with Injector and loading it in Module B before applying it as a transformation, but the DI layer hasn't been initialised yet so it fails.

Two options I can see:

  • We allow the second argument of updater.component() to accept a string, which would lazily load in a similar way to %$MyServiceName in PHP Injector (note that I have no idea if this would actually work)
  • Add another part of Injector that allows for service definitions. This part may not allow transformations in order for it to be loaded before the rest of the DI layer so they can be used themselves to transform other components.

cc @unclecheese


Workaround: Module A has coupling, and applies its HOC to every module it knows about, since it can load its HOC via FS imports instead of through injector.

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

No branches or pull requests

1 participant