Through the binary

a full stack enthusiast interested in Javascript / Typescript / Kotlin / Python / React / React Native / (Android & iOS) native / Cloud

I’ve heard mobx-state-tree for a while. Today I looked into it, and found it’s pretty lovely. Kind of the fat model pattern. Where it could make the code much more cleaner and far more less boilerplate compare to redux. Today, let’s see how to make nested level in mobx-state-tree.

Read more »

Styled components will be good if you use it from start, but things could be tricky in terms of mixing it up with other libraries or even your own code. Today, I will show you how to use styled components to generate css class and pass it to the 3rd party lib or your own component.

Read more »

There are times when some data is updated, you want to update multiple UI, be them activities or fragments. You can update them manually but that code will look messy. Or you can use the observable pattern to update the UI every time the source data gets updated. Today I will show you how to use MVVM and ViewModel + LiveData from Google’s new architecture component to achieve this. You can use RxJava to do the same thing. architecture component will be easier and less error-prone. Because they are life-cycle aware.

Read more »

Previously, we talked about how to do mock using dagger 2 and dagger-android. But as the wise man said: If You Didn't Test It, It Doesn't Work. So let’s see how to do the test. An important part of doing the UI test is mock, we don’t really want to deal with network request even it allows us to. Today, I share the knowledge of how to mock the injections from dagger-android in the UI test (instrumented tests). I write this because most of the online tutorials are using dagger-android in a dagger 2 way which leads to more code, or even worse, some mixed up usage will make people even more confused. Even though confuse is a word that tends to be bound with dagger. :D Oh, well, it’s a bad joke.

Read more »
0%