typedi icon indicating copy to clipboard operation
typedi copied to clipboard

feat: list of various doc updates

Open NoNameProvided opened this issue 4 years ago • 0 comments

Description

This issue describes a list of various updates to the documentation.

General

  • [ ] explain that injection only happens when class created via Container.get
  • [ ] explain cyclic dependency injection only works with property injection
  • [ ] add example for mocking classes with TypeDI
    • example: Container.set({ id: MyRealClass, type: MyMockedClass })
    • example: Container.set({ id: MyRealClass, value: { doStuff: () => console.log('mocked') }})
  • [ ] explain difference between setting values with type and value
  • [ ] explain how custom factories work (class and function factories
    • eg: @Service({ factory: [CarFactory, 'create'] })
    • eg: @Service({ factory: carFactory })
  • [ ] explain multiple: true when registering services
  • [ ] explain how services are overwritten when re-registered
    • this needs extra implementation: allow throwing error when service already exists
  • [ ] explain container inheritance
    • this needs implementation, current behaviour will change
  • [ ] add documentation for configuration with Babel (to retain type metadata emitted by Typescript)

@Service decorator

  • [ ] add documentation for named services (eg: @Service('scopeA.myservice'))
    • can be injected with the same name only (eg: @Inject('scopeA.myservice'))

@Inject decorator

  • [ ] explaining that only constructable types are auto-inferred (eg: you must provide ID for a string value

NoNameProvided avatar Feb 21 '21 09:02 NoNameProvided