Skip to content

feat: list of various doc updates #229

@NoNameProvided

Description

@NoNameProvided

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    flag: needs docsIssues or PRs which still need documentation added.type: featureIssues related to new features.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions