-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add lifecycle events to activity/presenters
- Loading branch information
1 parent
80c9265
commit 5eee482
Showing
10 changed files
with
32 additions
and
42 deletions.
There are no files selected for viewing
2 changes: 0 additions & 2 deletions
2
app/src/main/java/com/karumi/jetpack/superheroes/domain/usecase/GetSuperHeroById.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 |
---|---|---|
@@ -1,10 +1,8 @@ | ||
package com.karumi.jetpack.superheroes.domain.usecase | ||
|
||
import androidx.annotation.WorkerThread | ||
import com.karumi.jetpack.superheroes.data.repository.SuperHeroRepository | ||
import com.karumi.jetpack.superheroes.domain.model.SuperHero | ||
|
||
class GetSuperHeroById(private val superHeroesRepository: SuperHeroRepository) { | ||
@WorkerThread | ||
operator fun invoke(id: String): SuperHero? = superHeroesRepository.get(id) | ||
} |
2 changes: 0 additions & 2 deletions
2
app/src/main/java/com/karumi/jetpack/superheroes/domain/usecase/GetSuperHeroes.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 |
---|---|---|
@@ -1,10 +1,8 @@ | ||
package com.karumi.jetpack.superheroes.domain.usecase | ||
|
||
import androidx.annotation.WorkerThread | ||
import com.karumi.jetpack.superheroes.data.repository.SuperHeroRepository | ||
import com.karumi.jetpack.superheroes.domain.model.SuperHero | ||
|
||
class GetSuperHeroes(private val superHeroesRepository: SuperHeroRepository) { | ||
@WorkerThread | ||
operator fun invoke(): List<SuperHero> = superHeroesRepository.getAllSuperHeroes() | ||
} |
2 changes: 0 additions & 2 deletions
2
app/src/main/java/com/karumi/jetpack/superheroes/domain/usecase/SaveSuperHero.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 |
---|---|---|
@@ -1,11 +1,9 @@ | ||
package com.karumi.jetpack.superheroes.domain.usecase | ||
|
||
import androidx.annotation.WorkerThread | ||
import com.karumi.jetpack.superheroes.data.repository.SuperHeroRepository | ||
import com.karumi.jetpack.superheroes.domain.model.SuperHero | ||
|
||
class SaveSuperHero(private val superHeroesRepository: SuperHeroRepository) { | ||
@WorkerThread | ||
operator fun invoke(superHero: SuperHero): SuperHero? = | ||
superHeroesRepository.save(superHero) | ||
} |
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
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
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
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