-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c0f5fd6
commit dd54ad3
Showing
1 changed file
with
50 additions
and
0 deletions.
There are no files selected for viewing
50 changes: 50 additions & 0 deletions
50
shared/data/src/commonMain/kotlin/com/android254/shared/data/repos/FeedRepositoryImpl.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,50 @@ | ||
package com.android254.shared.data.repos | ||
|
||
import com.android254.shared.domain.models.FeedDomainModel | ||
import com.android254.shared.domain.repos.FeedRepository | ||
import kotlinx.coroutines.flow.Flow | ||
import kotlinx.coroutines.flow.flowOf | ||
|
||
class FeedRepositoryImpl : FeedRepository { | ||
override fun fetchFeed(): Flow<List<FeedDomainModel>> { | ||
return flowOf( | ||
listOf( | ||
FeedDomainModel( | ||
title = "After Party", | ||
body = "We will have an after party, All are welcomed.", | ||
topic = "", | ||
url = "", | ||
image = "", | ||
createdAt = "" | ||
) | ||
) | ||
) | ||
} | ||
|
||
override fun fetchFeedById(id: Int): Flow<FeedDomainModel?> { | ||
return flowOf( | ||
FeedDomainModel( | ||
title = "After Party", | ||
body = "We will have an after party, All are welcomed.", | ||
topic = "", | ||
url = "", | ||
image = "", | ||
createdAt = "" | ||
) | ||
) | ||
} | ||
|
||
override suspend fun syncFeed() { | ||
val feeds = mutableListOf<FeedDomainModel>() | ||
feeds.add( | ||
FeedDomainModel( | ||
title = "After Party", | ||
body = "We will have an after party, All are welcomed.", | ||
topic = "", | ||
url = "", | ||
image = "", | ||
createdAt = "" | ||
) | ||
) | ||
} | ||
} |