Replies: 2 comments 1 reply
-
The
The original style of registering dependencies required you to provide a key path to locate the dependency. So you would do This new style, which isn't always appropriate to use, allows you to skip the key path and resolve the dependency from its type alone, using |
Beta Was this translation helpful? Give feedback.
-
It mainly provides parity with the new @Environment(Model.self) var model
// ...
.environment(model) vs. @Dependency(Client.self) var client
// ...
.dependency(client) Is there a way to make this clearer? |
Beta Was this translation helpful? Give feedback.
-
The 1.9 migration guide includes this example:
Two questions. First, how is this API similar to the previous example of the new
@Dependency(SomeClient.self)
? Second, what does "the type of mockAPIClient determines how the dependency is overridden" mean? How can overrides of dependencies differ in the first place?Beta Was this translation helpful? Give feedback.
All reactions