reduxkotlin / redux-kotlin

Redux implementation for Kotlin (supports multiplatform JVM, native, JS, WASM)
https://reduxkotlin.org
MIT License
426 stars 32 forks source link

[WIP] enforce same thread on getState() #33

Closed patjackson52 closed 4 years ago

patjackson52 commented 4 years ago

First pass at thread enforcement. This throws an exception when 'getState' is accessed from a thread other than the one the store was created on. The sample app now throws the exception when tapping the first button. This is only here for the draft PR. TODO

Before this PR, if accessed from another thread it may through the exception from the isDispatching check if dispatching was happing on another thread. This new exception will be more informative.

@AOrobator thoughts?