Best way to observe changes to CoreData using the ReducerProtocol and SwiftConcurrency #1971
Closed
JackYoung2
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi everyone,
I’m trying to hook up a listener to changes in CoreData in the ReducerProtocol version of TCA. I want to set a listener up on viewDidAppear, observe changes in the data model and automatically convert the NSManagedObject into a Struct, and update my app state and UI. I could accomplish this with a combine Publisher, but I’d like to know if there’s a suitable swift concurrency tool I could use instead. I’ve played around with Async stream and async iterator but have been unable to accomplish the task so far.
Here's what I’m trying to do in the reducer:
And in the
ExercisesFetchedResultsProvider
I’m trying to graft anNSFetchedResultsController
with a delegate callback onto some kind of async sequence or async iterator. Can somebody tell me the right tool for the job, or am I trying to fit a square peg into a round hole?Thanks very much in advance
Beta Was this translation helpful? Give feedback.
All reactions