Skip to content

Commit

Permalink
add FeedRepositoryImpl
Browse files Browse the repository at this point in the history
  • Loading branch information
kibettheophilus committed Jun 19, 2024
1 parent b2eb82c commit 7d0d4d4
Showing 1 changed file with 50 additions and 0 deletions.
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 = ""
)
)
}
}

0 comments on commit 7d0d4d4

Please sign in to comment.