vilicvane / entrance-decorator

A minimal solution of dependency injection for projects that scale.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question, why is this an IOC Container

linonetwo opened this issue · comments

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?

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);

  // ...
};

I'm too young too simple to understand these...My university didn't teach me this.