-
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
KeyPath
of the aliased dependency inDependencies
- to: A
KeyPath
of another dependency inDependencies
that 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
KeyPath
of the aliased dependency inDependencies
- to: A
KeyPath
of another dependency inDependencies
that serves as a reference value.
Generated at 2022-08-22T21:22:01+0000 using swift-doc 1.0.0-rc.1.