-
Notifications
You must be signed in to change notification settings - Fork 10
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
[Proposal] Resolve injections in properties #2
Labels
enhancement
New feature or request
Comments
Your example already works with class Config {
url = "https://google.com";
}
class SubService {
configModel = inject(this, Config)
}
class MainService {
prop = new SubService();
props = [new SubService(), new SubService()];
}
class Html extends React.Component {
static contextType = InjectorContext;
service = inject(this, MainService);
render() {
html = this;
return <div />;
}
}
let html: Html;
const App = provider(Config, MainService)(Html);
render(<App />, document.createElement("div"));
expect(html.service.prop.configModel.url).toBe("https://google.com");
expect(html.service.props[0].configModel).toBe(html.service.prop.configModel);
expect(html.service.props[1].configModel).toBe(html.service.prop.configModel); But with decorators it can't work. Because |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi. I have a proposal. There is an example:
The text was updated successfully, but these errors were encountered: