mench / dependency-injection-es6

MIT License
16 stars 1 forks source link

Add Example for How to inject when class extends another ES6 class #5

Open codeuniquely opened 6 years ago

codeuniquely commented 6 years ago
import { inject } from 'dependency-injection-es6';
import Data from 'services/Data';

@inject(Data)
class Filter extends Component {
  constructor (props, Data) {
    super(props);
    this.dataServices = Data;
  }
  ...
}

export default Filter;

Here when I look at Data (or this.dataServices) - it is just an Empty "Proto" Object - with no properties or data

Can you show how this class would be injected in the Docs ..