Skip to content
Discussion options

You must be logged in to vote

The short answer is you don't store reference types in state*. Reference types, which can be mutated from afar, are not a good fit for a uni-directional architecture like TCA, which prescribes that state may only be mutated in response to receiving actions. If a dependency you interact with, eg an Apple API, emits a reference type, you need to make a value type you can map it into before returning those values to state.

You are correct to notice that these kinds of APIs, either because you need to hold onto some long-lived reference type, or because they emit or take references types in their API, need to be wrapped in the dependency system. You interact with dependencies you've defined a…

Replies: 3 comments 6 replies

Comment options

You must be logged in to vote
6 replies
@schornon
Comment options

@kamcma
Comment options

@schornon
Comment options

@kamcma
Comment options

@schornon
Comment options

Answer selected by schornon
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants