Manually refreshing Shared from the outside, eg from SwiftUI's .refreshable { }
#6
-
During the beta of the shared tools in TCA, an isowords PR demonstrated a way to initiate a shared state refresh manually from the outside. This could be quite useful for state that is conceptually an external source of truth, but is not inherently observable and instead must be proactively fetched. For example: a response from a restful HTTP GET request, that is displayed in the SwiftUI At one point when I explored implementing the technique from the isowords PR myself, I was blocked by the fact that this appeared to rely on Have there been any other explorations along these lines? I haven't had time to study all the new case studies in detail yet; do any of them have anything like this? Has anyone else explored what's possible with the public API as we know it from TCA? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
@kamcma In this library's release we've introduced both |
Beta Was this translation helpful? Give feedback.
@kamcma In this library's release we've introduced both
load
andsave
methods onShared
andSharedReader
for eagerly requesting that any underlying shared persistence key does its thing. Does this help?