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 view injection via JSX #14

Open
tbuschto opened this issue Jun 28, 2018 · 1 comment
Open

Support view injection via JSX #14

tbuschto opened this issue Jun 28, 2018 · 1 comment

Comments

@tbuschto
Copy link
Member

tbuschto commented Jun 28, 2018

It should be possible to let views be injected when using JSX expressions.

One option is to let createElement first check the attached injector for injectionHandlers of that type. If they are present, use that handler, otherwise create instance directly. To pass the creation properties a new decorator @injectionParam could be used to mark a parameter index for passing the injection parameter, or an option of @injectable. Or just assume it's the first parameter.

@tbuschto
Copy link
Member Author

Alternatively provide a good pattern to inject constructors to be used by JSX, e.g.

const MyViewConstructor = resolveConstructor(MyViewConstructor);?

Of course this should already Work:

const {MyViewConstructor} = resolve(ViewsPovider);

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