Sharing across modules #190
Unanswered
lilidotshi
asked this question in
Q&A
Replies: 1 comment 7 replies
-
Hi @lilidotshi, you have most likely linked either Sharing or Dependencies to your test target, which creates duplicate symbols. You may even have some warnings in your logs about this. Make sure you do not link our libraries to your test target, and instead only link the target you are testing. |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi! I'm currently implementing sharing of state across our app. However i'm encountering a situation where each module seems to be instantiating its own version of the variable "inMemory."
Say for instance, I have FrameworkA, which handles these some state change like such:
And then in my main app I have a test that looks like this:
In my case, I'm seeing that updateString isn't triggering a change in the test. More curiously, the client will print out "Hello" (its initial string) and the test will print out "Test Initial", it's initial string, which I am to understand is not supposed to happen because it should have been accessed.
NOTE: this is not a great example, because I actually tried the bare bones example and it works as expected, except if i try this pattern in my actual app, where I'm encountering the unexpected behavior. Any ideas on why it would seem like the client and the test are running on two different instances of memory?
Beta Was this translation helpful? Give feedback.
All reactions