-
Notifications
You must be signed in to change notification settings - Fork 2
useDependency
API / useDependency hook
This hook has multiple overloads.
Resolves the requested dependency using the resolver in the current context.
function useDependency<T>(
dependency: ResolvableSimpleDependency<T>
): T
Source reference: src/dependencies/UseDependency.ts:26
.
- T - The dependency type to resolve.
-
dependency: ResolvableSimpleDependency<T>
The dependency to resolve.
Returns the resolved dependency.
- IDependencyResolver
- IDependencyContainer
- ResolvableSimpleDependency<T>
- useDependencyResolver
- useViewModelDependency
- DependencyResolverProvider
- DependencyResolverScope
Resolves the requested complex dependency using the resovler in the current context.
function useDependency<T, TAdditional extends readonly any[]>(
dependency: ComplexDependency<T, TAdditional>,
additionalDependencies: TAdditional
): T
Source reference: src/dependencies/UseDependency.ts:47
.
-
T - The dependency type to resolve.
-
TAdditional - A tuple representing additional parameters required by the constructor.
-
dependency: ComplexDependency<T, TAdditional>
The complex dependency to resolve. -
additionalDependencies: TAdditional
Additional constructor arguments which also act as dependencies, if one of them changes the dependency will be reinitialized.
Returns the resolved dependency.
Overview
Motivation
Guides and Tutorials - Getting Started
Releases
CodeSandbox
API
Events
IEvent
IEventHandler
EventDispatcher
ViewModels
INotifyPropertiesChanged
ViewModel
Forms
Form
IFormFieldConfig
FormField
ReadOnlyFormCollection
FormCollection
IConfigurableFormCollection
FormSetupCallback
Validation
IValidator
ValidatorCallback
IObjectValidator
IValidatable
Validation / Triggers
WellKnownValidationTrigger
ValidationTrigger
Observable Collection
ReadOnlyObservableCollection
ObservableCollection
INotifyCollectionChanged
CollectionChangeOperation
INotifyCollectionReordered
CollectionReorderOperation
Observable Map
ReadOnlyObservableMap
ObservableMap
INotifyMapChanged
MapChangeOperation
Observable Set
ReadOnlyObservableSet
ObservableSet
INotifySetChanged
SetChangeOperation
Dependency Handling
IDependencyResolver
IDependencyContainer
DependencyContainer
useDependency
useViewModelDependency
useDependencyResolver
React Hooks
useViewModel
useViewModelMemo
useObservableCollection
useObservableMap
useObservableSet