Jan Lund
10/01/2020, 5:20 PMIan Lake
10/01/2020, 5:35 PMfirst()
on the Flow when you need it avoids those issuesCasey Brooks
10/01/2020, 5:38 PMObservable
delegated property might be what you’re looking for in a non-coroutines option https://kotlinlang.org/docs/reference/delegated-properties.html#observableJan Lund
10/01/2020, 5:50 PMfirst()
is a suspend fun I would have to use coroutines everywhere I want to check that value, right? If I want to return a value from a function which uses logic based on a setting I would have to convert the function to use coroutines or a take in a callback right?Ian Lake
10/01/2020, 5:50 PMsuspend
method, yesJan Lund
10/01/2020, 5:56 PMCasey Brooks
10/01/2020, 5:59 PMObservable
delegated property for that boolean flag, you can be notified on any changes to that property and push that change out to a list of listeners (I think you’d have to manage the list of subscribers manually, but it’s pretty trivial). Using and Observable property, you wouldn’t need to use coroutinesJan Lund
10/01/2020, 6:11 PMsuspend
which need to be invoked in a coroutine. Let's say the user has a setting like for example useAmPm true/false. Then in a method where I want to return formatted time I would have to be in a coroutine or launch a coroutine unless I have a coroutine running somewhere updating a property which doesn't seem recommended. Anyway I appreciate the suggestions.Casey Brooks
10/01/2020, 6:24 PM