A Learner.
Pinned Loading
-
Am having an error wrapper class ove...
Am having an error wrapper class over the normal Exception interface, with this I can parse errors and handle them for a better response , for example the Socket timeout exception which is common in most network requests. 1sealed class AppError(
2override val message: String? = null
3) : Exception(){
4data object SocketTimeOutError : AppError("Failed to connect, please check your internet connection and retry.")
5}
-
An abstraction of spring security ...
An abstraction of spring security methods to interact with the jwt, requires the libraries jjwt-api jjwt-impl jjwt-jackson The implementation is really similar but can be customized 1public interface JwtService {
23final String SECRET_KEY = "";
45 -
A viewmodel factory, can be used to ...
A viewmodel factory, can be used to provision a viewmodel from a kotlin application that has lifecycle. 1@Suppress("UNCHECKED_CAST")
2class MainViewModelFactory(val application: Application) : ViewModelProvider.Factory {
3override fun <T : androidx.lifecycle.ViewModel> create(modelClass: Class<T>): T {
4return MainViewModel(application) as T
5}
Something went wrong, please refresh the page to try again.
If the problem persists, check the GitHub status page or contact support.
If the problem persists, check the GitHub status page or contact support.