I hate the reducer form in redux. switch (action.type)... just looks ugly and doesn't provide autocompletion / type-checking info in your IDE. I prefer to use mobx / rxjs.
Instead of:
switch (action.type):
case LOAD_TALKS:
...
case LOAD_TALKS_ERROR:
...
it would be:
class SomeStateManager {
state
loading
error
loadTalks(...params) {
// do something with state
loading = true
}
loadTalksError(...params) {
// do something with state
loading = false
error = params.error
}
}
Especially when using TypeScript, this would make much more sense and give you the benefit of type-checking.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I hate the
reducer
form in redux.switch (action.type)...
just looks ugly and doesn't provide autocompletion / type-checking info in your IDE. I prefer to usemobx
/rxjs
.Instead of:
it would be:
Especially when using TypeScript, this would make much more sense and give you the benefit of type-checking.