Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make livedata available on Apple targets #4955

Closed
Mats-Hjalmar opened this issue Jun 11, 2024 · 3 comments
Closed

Make livedata available on Apple targets #4955

Mats-Hjalmar opened this issue Jun 11, 2024 · 3 comments
Assignees
Labels
question Not a bug, but question or comment wontfix This will not be worked on

Comments

@Mats-Hjalmar
Copy link

I have an App where we are using MutableStateFlow to share data to the UI. Problem is that we need to update the view when the same value is emitted on the flow.

@Mats-Hjalmar Mats-Hjalmar added enhancement New feature or request submitted labels Jun 11, 2024
@pablichjenkov
Copy link

Instead of a StateFlow use a SharedFlow with repeat 1. You will also have to update the Update Policy in your compose State, because compose State also don't Emit events on the same event.
Bottom line you should change your design into something that represents your state not depending on this state updates.
That would be better for performance too.

@MatkovIvan
Copy link
Member

Thanks @pablichjenkov for reply regarding the specific issue.

I'll just add regarding porting LiveData to multiplatform - there is no plan to do that.
Obvious reasons are:

  • LiveData is written on java
  • There is Flow equivalent with all lifecycle bindings

@MatkovIvan MatkovIvan self-assigned this Jun 11, 2024
@MatkovIvan MatkovIvan added question Not a bug, but question or comment and removed enhancement New feature or request submitted labels Jun 11, 2024
@MatkovIvan MatkovIvan added the wontfix This will not be worked on label Jun 11, 2024
@okushnikov
Copy link

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Not a bug, but question or comment wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

4 participants