You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#125 Introduced the yieldLoading API for SharedKeys to yield a new loading state to the underlying reference of @Shared through SharedSubsciber. Currently, when new data is yielded from through SharedSubscriber, the loading state is reset back to its original state. When SharedKeys need to make long-running network calls within subscribe this works fine. However, if the SharedKey needs to stream chunks of data (such as streaming the text from an LLM), this can cause flickering in the UI around any elements that depend on the isLoading property of an @Shared.
For instance, this mock SharedKey will stream chunks of text at a very fast rate, and we want to disable the reload button whilst the chunks are being streamed. However, since every call to yield on SharedSubscriber resets the loading state, there's a chance that the "Reload" button in the UI will flicker as shown in the video.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
#125 Introduced the
yieldLoading
API for SharedKeys to yield a new loading state to the underlying reference of@Shared
throughSharedSubsciber
. Currently, when new data is yielded from throughSharedSubscriber
, the loading state is reset back to its original state. When SharedKeys need to make long-running network calls withinsubscribe
this works fine. However, if the SharedKey needs to stream chunks of data (such as streaming the text from an LLM), this can cause flickering in the UI around any elements that depend on theisLoading
property of an@Shared
.For instance, this mock SharedKey will stream chunks of text at a very fast rate, and we want to disable the reload button whilst the chunks are being streamed. However, since every call to
yield
onSharedSubscriber
resets the loading state, there's a chance that the"Reload"
button in the UI will flicker as shown in the video.Screen.Recording.2025-04-22.at.10.09.02.PM.mov
To best solve this, I think there should be an API to yield data to
SharedSubscriber
without resetting the loading state. Possibly something like:What do you think?
Beta Was this translation helpful? Give feedback.
All reactions