forked from mars885/gamedge
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor igdb-api to use Dagger Hilt
- Loading branch information
Paul Rybitskyi
committed
Sep 8, 2020
1 parent
a3ed96a
commit 35240b1
Showing
7 changed files
with
117 additions
and
86 deletions.
There are no files selected for viewing
This file contains 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
44 changes: 0 additions & 44 deletions
44
...src/main/java/com/paulrybitskyi/gamedge/igdb/api/datastore/GamesServerDataStoreFactory.kt
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
53 changes: 53 additions & 0 deletions
53
igdb-api/src/main/java/com/paulrybitskyi/gamedge/igdb/api/di/DataStoreModule.kt
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* Copyright 2020 Paul Rybitskyi, [email protected] | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.paulrybitskyi.gamedge.igdb.api.di | ||
|
||
import com.paulrybitskyi.gamedge.data.datastores.GamesServerDataStore | ||
import com.paulrybitskyi.gamedge.igdb.api.IgdbApi | ||
import com.paulrybitskyi.gamedge.igdb.api.datastore.EntityMapper | ||
import com.paulrybitskyi.gamedge.igdb.api.datastore.GamesServerDataStoreImpl | ||
import dagger.Module | ||
import dagger.Provides | ||
import dagger.hilt.InstallIn | ||
import dagger.hilt.android.components.ApplicationComponent | ||
import javax.inject.Singleton | ||
|
||
@InstallIn(ApplicationComponent::class) | ||
@Module | ||
internal object DataStoreModule { | ||
|
||
|
||
@Singleton | ||
@Provides | ||
fun provideGamesServerDataStore( | ||
igdbApi: IgdbApi, | ||
entityMapper: EntityMapper | ||
): GamesServerDataStore { | ||
return GamesServerDataStoreImpl( | ||
igdbApi = igdbApi, | ||
entityMapper = entityMapper | ||
) | ||
} | ||
|
||
|
||
@Provides | ||
fun provideEntityMapper(): EntityMapper { | ||
return EntityMapper() | ||
} | ||
|
||
|
||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,8 +16,4 @@ | |
|
||
plugins { | ||
kotlin() | ||
} | ||
|
||
dependencies { | ||
implementation(deps.kotlin.stdLib) | ||
} |
This file contains 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