Robert Jaros
08/05/2019, 6:56 AMdispatch
in Thunk
to operator invoke
andreworobator
08/28/2019, 12:59 PMPatrick Jackson
08/28/2019, 2:15 PMtypealias SealedReducer<TState, TAction> = (state: TState, action: TAction) -> TState
typealias SealedReducer<TState, TAction> = (state: TState, action: TAction) -> TState
inline fun <TState, reified TAction> sealedReducer(crossinline reducer: SealedReducer<TState, TAction>): Reducer<TState> {
return {state, action ->
if (action is TAction) {
reducer(state, action)
} else {
state
}
}
}
sealed class LoginScreenAction
class LoginButtonTap: LoginScreenAction()
val loginScreenReducer = sealedReducer<TestState, LoginScreenAction> { state, action ->
when(action) {
is LoginButtonTap -> state
}
}
andreworobator
08/28/2019, 2:25 PMandreworobator
08/28/2019, 5:24 PMThe intended guarantee is that Redux eventually calls all subscribers with the most recent state available, but not that it always calls each subscriber for each action. The store state is available in the subscriber simply by calling store.getState()This explanation is more about disallowing the action in the subscriber which i totally get and support. but having the most recent state in the subscriber could be easily solved with
(State) -> Unit
and you could eliminate a whole class of bugsandreworobator
08/28/2019, 7:40 PMlisteners.forEach
could have listeners mutated right in the middle of the loop which would be weirdBig Chungus
09/09/2019, 12:11 PMandreworobator
09/19/2019, 10:31 PMPatrick Jackson
09/22/2019, 4:28 PMandreworobator
09/23/2019, 12:10 AMandreworobator
09/23/2019, 1:47 AMBig Chungus
09/26/2019, 12:34 PMandreworobator
10/23/2019, 7:21 PMGuillermo Robles
12/09/2019, 9:47 PMNikky
12/12/2019, 2:50 PMNikky
12/12/2019, 4:41 PMNikky
12/12/2019, 10:39 PMNikky
12/13/2019, 3:37 PMNikky
12/15/2019, 9:35 AMNikky
12/20/2019, 8:11 PMBig Chungus
12/30/2019, 10:47 AMNikky
01/04/2020, 4:20 PMredux.Store
api looks like it could return anythingNikky
01/06/2020, 2:10 PMjs("if(window.__REDUX_DEVTOOLS_EXTENSION__ )window.__REDUX_DEVTOOLS_EXTENSION__ ();else(function(f){return f;});")
https://github.com/lawik123/kotlin-poc-frontend-react-redux/blob/44eceb985a6871a2c13e6c5487777d55acf64bfb/src/main/kotlin/nl/lawik/poc/frontend/reactredux/Index.kt#L17Big Chungus
01/12/2020, 9:38 AMCould not find org.reduxkotlin:lib-win:0.3.1.
Searched in the following locations:
- <https://jcenter.bintray.com/org/reduxkotlin/lib-win/0.3.1/lib-win-0.3.1.pom>
- <https://repo.maven.apache.org/maven2/org/reduxkotlin/lib-win/0.3.1/lib-win-0.3.1.pom>
- file:/C:/Users/mpetuska/.m2/repository/org/reduxkotlin/lib-win/0.3.1/lib-win-0.3.1.pom
- <https://kotlin.bintray.com/kotlin-js-wrappers/org/reduxkotlin/lib-win/0.3.1/lib-win-0.3.1.pom>
- <https://dl.bintray.com/kotlin/kotlinx.html/org/reduxkotlin/lib-win/0.3.1/lib-win-0.3.1.pom>
Am I missing something?Big Chungus
01/12/2020, 12:51 PMkotlin.native.concurrent.InvalidMutabilityException: mutation attempt of frozen kotlin.native.internal.Ref
when trying to createStoreNikky
02/06/2020, 9:07 PMjava.lang.IllegalStateException: You may not call the store from a thread other than the thread on which it was created.
but how would be the easiest way to lets say.. make sure that this does not happen by using the same thread / coroutine context ?tim
02/28/2020, 2:34 PMdata class
, a Map, or something else entirely? I'm coming from the JS/TS ecosystem where libraries like ReduxToolkit/Immutable.JS make this a straightforward decision but I'm curious what 'best practice' looks like here in kotlin-land 🙏
In my first attempt I'm using data classes but finding that only 1 or 2 layers of nesting starts to cause issues in my reducers. So i could either go with Maps and forget data classes or reduce the nesting... or perhaps theres a better way altogether?Big Chungus
03/23/2020, 9:32 PMPatrick Jackson
03/24/2020, 1:30 PMRobert Jaros
03/24/2020, 2:05 PMRobert Jaros
03/24/2020, 2:05 PMPatrick Jackson
03/24/2020, 2:11 PM