-
Hey @ALL, I've a in-memory shared user in my app. When I subscribe to changes within a Task to it I do not receive the changes: Task {
for await user in $user.publisher.values {
print(user)
}
} This prints only the initial value but not the changes. The task never finishes nor does it get cancelled as far as I know. When I subscribe to the changes via Combine it works: cancellable = $user.publisher.sink { user in
print(user)
} What am I doing wrong? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
In-memory keys don't implement any kind of subscribing whatsoever currently: https://github.com/pointfreeco/swift-sharing/blob/main/Sources/Sharing/SharedKeys/InMemoryKey.swift#L56-L60 I suppose it would be a welcome addition to the library in a PR? |
Beta Was this translation helpful? Give feedback.
Hi @ALL. It was my own dumbness. I had a guard statement within the
for await
loop and in its else block I had a return statement which canceled the loop. 🫣