ContainerOperations extension

Extension on App providing syntactic sugar for dependency resolution and binding.

on

Methods

bind<T>(T instance) → void

Available on App, provided by the ContainerOperations extension

Binds a concrete instance to type T in the container.
bindInstance<T>(T instance) → void

Available on App, provided by the ContainerOperations extension

Registers a singleton instance of type T.
make<T>() → T

Available on App, provided by the ContainerOperations extension

Alias for resolve. Resolves a registered instance.
resolve<T>() → T

Available on App, provided by the ContainerOperations extension

Resolves a registered instance of type T.
resolveInstance<T>() → T

Available on App, provided by the ContainerOperations extension

Resolves an instance of type T from the container.
tryMake<T>() → T?

Available on App, provided by the ContainerOperations extension

Alias for tryResolve.
tryResolve<T>() → T?

Available on App, provided by the ContainerOperations extension

Attempts to resolve an instance of type T. Returns null if not found.
tryResolveInstance<T>() → T?

Available on App, provided by the ContainerOperations extension

Safely attempts to resolve an instance. Returns null on failure.