android-mvi-architecture's Issues
No Reducers in this sample.
As you mentioned in MVI Architecture Medium post:
Reducer is something that produces a new state by combining the current state, instead, we have a suspend function for the state production in the sample.
Below are my questions:
- If we use Reducers, do we better have them declared in as singletons, injected into the
viewmodel
?
this logic seems to mix the reducers and data fetching, right?- Are you using MVI in the current app development, and what are the challenging point of using MVI?
Thanks for sharing the article anyway. :)
Crash without internet connection
First, good example and good article on medium. If I turn off internet connection the app crash, could be it's trying to get "userApi.getUser()" on main thread? I moved userApi.getUser() in a variable and I pass it to the updateState and now it works. What do you think? I'm trying to understand the behavior with coroutines.
private fun fetchData() {
viewModelScope.launch(Dispatchers.IO) {
try {
updateState { it.copy(isLoading = true) }
val userList = userApi.getUser()
updateState { it.copy(isLoading = false, users = userList) }
}
catch (e: Exception) {
updateState { it.copy(isLoading = false, errorMessage = e.message) }
}
}
}
pass parameter in api
Greate tutorial my friend, i have question how can i pass parameter in retrofit api using this architecture ?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.