Skip to content

What's TCA's stance on live-only dependencies? #1586

Answered by mbrandonw
davdroman asked this question in Q&A
Discussion options

You must be logged in to vote

It is totally fine to use @Dependency in the way you have done here, and it's totally fine to have the test/preview/live value all be the same thing. You can even use @Dependency outside the context of a reducer, which is why we may open source it as a separate library someday soon.

But, I do have a question. Is there ever a time that a non-JSONDecoder.iso8601 is used? If everything should be using it, then maybe it's ok just to have a global value that all code can use?

However, if non-.iso8601 values can be used, then I think what you have done here is fine, and again it is OK for the test/preview/live value to all be the same thing.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@davdroman
Comment options

Answer selected by davdroman
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants