-
Notifications
You must be signed in to change notification settings - Fork 10
AliasBuilder
tgrapperon edited this page Aug 22, 2022
·
4 revisions
A type that is used to configure dependencies aliases when using the DerivedEnvironment
property wrapper.
public struct AliasBuilder<Environment> where Environment: ComposableEnvironment Add a new dependency alias to the builder
public func alias<Dependency>(
_ dependency: WritableKeyPath<Dependencies, Dependency>,
to default: WritableKeyPath<Dependencies, Dependency>
) -> Self You can chain calls to define multiple aliases:
builder
.alias(\.main, to: \.mainQueue)
.alias(\.uuid, to: \.idGenerator)
…See the discussion at DependenciesAccessing.aliasing(:to:) for more information.
- dependency: The
KeyPathof the aliased dependency inDependencies - to: A
KeyPathof another dependency inDependenciesthat serves as a reference value.
Add a new dependency alias to the builder
public func alias<Dependency>(
_ dependency: WritableKeyPath<Dependencies, Dependency>,
to default: WritableKeyPath<Dependencies, Dependency>
) -> Self You can chain calls to define multiple aliases:
builder
.alias(\.main, to: \.mainQueue)
.alias(\.uuid, to: \.idGenerator)
…See the discussion at DependenciesAccessing.aliasing(:to:) for more information.
- dependency: The
KeyPathof the aliased dependency inDependencies - to: A
KeyPathof another dependency inDependenciesthat serves as a reference value.
Generated at 2022-08-22T21:22:01+0000 using swift-doc 1.0.0-rc.1.