Skip to content

Type forwarding, weak types & optionals

Compare
Choose a tag to compare
@ilyapuchka ilyapuchka released this 08 Jun 21:48
· 253 commits to develop since this release

New features

  • Added weakly-typed API to resolve components when exact type is unknown during compile time.
    #79, @ilyapuchka
  • Added type forwarding feature. You can register the same factory to resolve different types.
    #89, @ilyapuchka
  • Container now can resolve optional types 🎉
    #84, @ilyapuchka
  • Added container context that provides contextual information during graph resolution process.
    #83, @ilyapuchka
  • Added method to validate container configuration.
    #87, @ilyapuchka
  • Added method to manually set value wrapped by auto-injection wrappers.
    #81, @ilyapuchka
  • Added separate error type for failures during auto-wiring.
    #85, @ilyapuchka

Note

With introduction of type-forwarding the behavior of func resolveDependencies(block: (DependencyContainer, T) throws -> ()) -> DefinitionOf<T, F> changed. Now you can call this method several times on the same definition. When instance is resolved using this definition the container will call all the blocks that you passed to this method in the same order as you called this method.