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
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
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 useMutableStateFlow
on Compose andObservableObject
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
orObservableObject
.An example where this is necessary is in our sample app "Store". We need to observe the global state that stores the shopping cart:
The text was updated successfully, but these errors were encountered: