useOptionalViewController
- useOptionalViewController<TContext, TService>(declaration: ControllerDeclaration<TContext, TService>): TService | undefined
- useOptionalViewController<TContext, TService, TDefault>(declaration: ControllerDeclaration<TContext, TService>, defaultValue: TDefault): TService | TDefault
Type parameters
Parameters
Returns TService | undefined
Returns parent's view controller that is provided for the given controller declaration.
Optional view controller can be used when the controller is not provided in the context.