dependencyOrNull
protected inline fun <TDependency> dependencyOrNull(path: Path, dependencyKey: String? = null): PropertyDelegateProvider<ComputedValue<T>, ReadOnlyProperty<ComputedValueContext, TDependency?>>(source)
protected inline fun <TDependency> dependencyOrNull(path: String, dependencyKey: String? = null): PropertyDelegateProvider<ComputedValue<T>, ReadOnlyProperty<ComputedValueContext, TDependency?>>(source)
Function used to declare a dependency to a path and delegate access to its value within a ComputedValueContext.
If the dependency could not be found in the form during the execution of the computed value, then accessing this dependency will return null.
It should be used as follows:
private val ComputedValueContext.dependencyKey: Type? by dependencyOrNull(path)Content copied to clipboard
Computed value dependency paths may contain a single recursive wildcard at the end, indicating that the computed value should be reevaluated by the form manager whenever a child value of the dependency changes. Otherwise, a dependency must contain no wildcards.