Question, why is this an IOC Container
linonetwo opened this issue · comments
lin onetwo commented
To be a dependency injection framework, it usually means inject an instance of class into another, but from readme, there seems to be no such action?
vilicvane commented
This is just a simple method to manage dependent providers, it is up to the developer to find a proper way handling how to inject those providers into something like React components.
For example, we use React Context
API for this purpose:
ReactDOM.render(
<EntrancesContext.Provider value={entrances}>
<App />
</EntrancesContext.Provider>,
document.getElementById('app'),
);
const App = () => {
const {messageService} = useContext(EntrancesContext);
// ...
};
lin onetwo commented
I'm too young too simple to understand these...My university didn't teach me this.