-
Notifications
You must be signed in to change notification settings - Fork 24
State Flow and Shared Flow
Devrath edited this page Jan 21, 2024
·
5 revisions
- Flows are mostly cold but
state-flow
andshared-flow
are exceptions here - The
St.Flow
andSh.Flow
exist independently of collectors. This means that these flows remain active even if there are no collectors. -
State Flow
is a special case ofshared flow
.
- This is a flow that acts independently of collectors - Meaning the
share flow
is active regardless of whether there are any collectors or not. - Shared flow emits a
current state
andnew state
to the subscribers. -
Shared-flow
never completes and remains active. Even though all the subscribers go away, TheShared Flow
remains active.
- State Flow is a version of Shared Flow