Tvede-dk / CommonsenseAndroidKotlin

MIT License
8 stars 0 forks source link

use coroutines for handling binding in databindings #7

Open Tvede-dk opened 6 years ago

Tvede-dk commented 6 years ago

instead of a "lazy" construct, we are to use the lazy construct from coroutines; this will allow us to avoid background threading access the binding part, thus crashing an app. ) construct is: val myLazyValue = async(start = CoroutineStart.LAZY) { ... } Use myLazyValue.await() when you need it

as seen in https://gist.github.com/elizarov/f27400a55c1502aacc35b4a3b2f5c9af