forked from tgrapperon/swift-composable-environment
-
Notifications
You must be signed in to change notification settings - Fork 0
AliasBuilder
maximkrouk edited this page May 5, 2022
·
1 revision
A type that is used to configure dependencies aliases when using the DerivedEnvironment
property wrapper.
public struct AliasBuilder<Environment> where Environment: GlobalDependenciesAccessing
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-05-05T11:18:52+0000 using swift-doc 1.0.0-rc.1.