When this is used in a React Native view, the time updates very quickly -- on the order of every 1 or 2 milliseconds. When timeAsState is used, the time updates every second as expected.
Is this just an example of using a Flow incorrectly i.e. without turning it into a StateFlow? Or is it an indication of a bug in the flow toReact code?
It demonstrates how the toolkit works and it reevaluates the flow many times, so one should be aware of this when using flows that are non deterministic
The Example app has a function
TimeProvider.time()
:https://github.com/voize-gmbh/reakt-native-toolkit/blob/main/example/android/shared/src/commonMain/kotlin/com/myrnproject/shared/TimeProvider.kt#L18
When this is used in a React Native view, the time updates very quickly -- on the order of every 1 or 2 milliseconds. When
timeAsState
is used, the time updates every second as expected.Is this just an example of using a Flow incorrectly i.e. without turning it into a
StateFlow
? Or is it an indication of a bug in the flowtoReact
code?