Skip to content

Compatible

tgrapperon edited this page Aug 22, 2022 · 1 revision

Compatible

This namespace is used to provide non-clashing variants to the DependencyKey protocol and the @Dependency property wrapper.

public enum Compatible 

Nested Type Aliases

DependencyKey

You can use this typealias if DependencyKey is clashing with other modules offering a similarly named protocol.

public typealias DependencyKey = _Dependencies.DependencyKey

You should be able to replace:

struct MainQueueKey: DependencyKey {  }

by

struct MainQueueKey: Compatible.DependencyKey {}

Dependency

You can use this typealias if @Dependency is clashing with other modules offering a similarly named property wrapper.

public typealias Dependency = ComposableEnvironmentDependency

You should be able to replace

@Dependency(\.mainQueue) var mainQueue

by

@Compatible.Dependency(\.mainQueue) var mainQueue

Dependency

You can use this typealias if @Dependency is clashing with other modules offering a similarly named property wrapper.

public typealias Dependency = ComposableEnvironmentDependency

You should be able to replace

@Dependency(\.mainQueue) var mainQueue

by

@Compatible.Dependency(\.mainQueue) var mainQueue

DependencyKey

You can use this typealias if DependencyKey is clashing with other modules offering a similarly named protocol.

public typealias DependencyKey = _Dependencies.DependencyKey

You should be able to replace:

struct MainQueueKey: DependencyKey {  }

by

struct MainQueueKey: Compatible.DependencyKey {}