mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-01-14 07:33:28 +01:00
Are main context object properties automatically updated from transactions? #347
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @zachwaugh on GitHub (Oct 28, 2020).
In general, are properties of the read-only main context objects live updated? Assuming they are fetched initially from the main data stack and only accessed from the main thread with all changes done in transactions. Sorry if this is an obvious question, but I couldn't find a clear answer. Here's a simple example:
From a quick test, it appears that the main dataStack properties are updated, but this comment indicates that would only be the case if there was an observer/monitor attached: https://github.com/JohnEstropia/CoreStore/issues/352#issuecomment-562797703. Hoping you can clear that up, thank you!
@JohnEstropia commented on GitHub (Oct 29, 2020):
Objects in the main thread would get updated, eventually. What I meant in the comment you linked is that if you rely on the timing of the updates you should be using one of the Observers/Publishers otherwise you have no control when they get updated
@zachwaugh commented on GitHub (Oct 29, 2020):
Perfect, thank you!