Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

Make it easier to subscribe to state changes from the native code #77

Open
Tiagoperes opened this issue Jan 13, 2023 · 0 comments
Open
Labels
backlog an item of the backlog enhancement New feature or request ui layer related only to the ui layer (nimbus swiftui or nimbus compose)
Milestone

Comments

@Tiagoperes
Copy link
Contributor

Today, to observe a state from the native code, it's necessary to implement the interface Dependent. To interact the nimbus state with the Compose or SwiftUi state we also need to use MutableStateFlow on Compose and ObservableObject on SwiftUI.

This process is more complicated than it should be. Instead, we should provide an easier way to subscribe to a state. An idea is to implement an extension that automatically provides the MutableStateFlow or ObservableObject.

An example where this is necessary is in our sample app "Store". We need to observe the global state that stores the shopping cart:

@Tiagoperes Tiagoperes added enhancement New feature or request backlog an item of the backlog ui layer related only to the ui layer (nimbus swiftui or nimbus compose) labels Jan 13, 2023
@Tiagoperes Tiagoperes added this to the 1.0.0 milestone Jan 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backlog an item of the backlog enhancement New feature or request ui layer related only to the ui layer (nimbus swiftui or nimbus compose)
Projects
Status: 📋 Backlog
Development

No branches or pull requests

1 participant