Created
November 4, 2018 17:44
-
-
Save myeonginwoo/aa6c8c2f5827f00ee4953c6853cae88e to your computer and use it in GitHub Desktop.
Revisions
-
myeonginwoo created this gist
Nov 4, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ // before sealed class NetworkState { class Init : NetworkState() class Loading : NetworkState() class Success(val item: Item) : NetworkState() class Error(val throwable: Throwable?) : NetworkState() } // after sealed class NetworkState<out T> { class Init : NetworkState<Nothing>() class Loading : NetworkState<Nothing>() class Success<out T>(val item: T) : NetworkState<T>() class Error(val throwable: Throwable?) : NetworkState<Nothing>() }