-
-
Save virendersran01/1b3ccd804f70c78ad7b36bda9604a3a0 to your computer and use it in GitHub Desktop.
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 characters
| package com.some.thing.di | |
| import android.util.SparseArray | |
| import com.some.thing.routing.Routable | |
| import com.some.thing.feature_main.MainRouter | |
| import com.some.thing.feature_boarding.BoardingRouter | |
| import com.some.thing.feature_login.LoginRouter | |
| import dagger.Module | |
| import dagger.Provides | |
| import dagger.hilt.InstallIn | |
| import dagger.hilt.android.components.ApplicationComponent | |
| @Module | |
| @InstallIn(ApplicationComponent::class) | |
| class RouterModule { | |
| private fun provideRouters(): SparseArray<Routable<*, *>> = | |
| SparseArray<Routable<*, *>>().apply { | |
| put(SplashRouter.deepLinkCode, SplashRouter) | |
| put(BoardingRouter.deepLinkCode, BoardingRouter) | |
| put(LoginRouter.deepLinkCode, LoginRouter) | |
| } | |
| @Provides | |
| fun provideRouterData(): SparseArray<Routable<*, *>> = provideRouters() | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment