-
-
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.
Update schema, enable explicit API mode for KMP modules.
- Loading branch information
1 parent
71ae5b8
commit 53799d7
Showing
27 changed files
with
135 additions
and
121 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
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
23 changes: 15 additions & 8 deletions
23
...c/commonMain/kotlin/io/github/reactivecircus/kstreamlined/kmp/data/feed/FeedRepository.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,31 +1,38 @@ | ||
package io.github.reactivecircus.kstreamlined.kmp.data.feed | ||
|
||
import co.touchlab.kermit.Logger | ||
import io.github.reactivecircus.kstreamlined.kmp.data.feed.model.FeedItem | ||
import io.github.reactivecircus.kstreamlined.kmp.data.feed.model.FeedOriginItem | ||
import io.github.reactivecircus.kstreamlined.kmp.feed.datasource.FeedDataSource | ||
import kotlinx.coroutines.flow.Flow | ||
import kotlinx.coroutines.flow.emptyFlow | ||
|
||
class FeedRepository( | ||
public class FeedRepository( | ||
private val feedDataSource: FeedDataSource | ||
) { | ||
|
||
val feedSyncState: Flow<FeedSyncState> = TODO() | ||
public val feedSyncState: Flow<FeedSyncState> = emptyFlow() | ||
|
||
suspend fun syncNow() { | ||
feedDataSource.loadFeedEntries(null, true) | ||
TODO() | ||
public suspend fun syncNow() { | ||
feedDataSource.loadFeedEntries(null, true).also { | ||
Logger.i("<<Number of entries: ${it.size}>>") | ||
it.forEach { entry -> | ||
Logger.i("${entry::class.simpleName}: ${entry.title}, ${entry.publishTime}}") | ||
} | ||
} | ||
} | ||
|
||
suspend fun selectFeedSource(feedOrigin: FeedOriginItem) { | ||
public suspend fun selectFeedSource(feedOrigin: FeedOriginItem) { | ||
feedOrigin.selected | ||
TODO() | ||
} | ||
|
||
suspend fun unselectFeedSource(feedOrigin: FeedOriginItem) { | ||
public suspend fun unselectFeedSource(feedOrigin: FeedOriginItem) { | ||
feedOrigin.selected | ||
TODO() | ||
} | ||
|
||
suspend fun getSavedFeedItems() { | ||
public suspend fun loadSavedFeedItems(): List<FeedItem> { | ||
TODO() | ||
} | ||
} |
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
29 changes: 14 additions & 15 deletions
29
...c/commonMain/kotlin/io/github/reactivecircus/kstreamlined/kmp/data/feed/model/FeedItem.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,48 +1,47 @@ | ||
package io.github.reactivecircus.kstreamlined.kmp.data.feed.model | ||
|
||
sealed interface FeedItem { | ||
val id: String | ||
val title: String | ||
val publishTimestamp: String | ||
val contentUrl: String | ||
val savedForLater: Boolean | ||
public sealed interface FeedItem { | ||
public val id: String | ||
public val title: String | ||
public val publishTime: String | ||
public val contentUrl: String | ||
public val savedForLater: Boolean | ||
|
||
data class KotlinBlog( | ||
public data class KotlinBlog( | ||
override val id: String, | ||
override val title: String, | ||
override val publishTimestamp: String, | ||
override val publishTime: String, | ||
override val contentUrl: String, | ||
override val savedForLater: Boolean, | ||
val featuredImageUrl: String?, | ||
val description: String, | ||
) : FeedItem | ||
|
||
data class KotlinYouTube( | ||
public data class KotlinYouTube( | ||
override val id: String, | ||
override val title: String, | ||
override val publishTimestamp: String, | ||
override val publishTime: String, | ||
override val contentUrl: String, | ||
override val savedForLater: Boolean, | ||
val thumbnailUrl: String, | ||
val description: String, | ||
) : FeedItem | ||
|
||
data class TalkingKotlin( | ||
public data class TalkingKotlin( | ||
override val id: String, | ||
override val title: String, | ||
override val publishTimestamp: String, | ||
override val publishTime: String, | ||
override val contentUrl: String, | ||
override val savedForLater: Boolean, | ||
val podcastLogoUrl: String, | ||
val tags: List<String>, | ||
) : FeedItem | ||
|
||
data class KotlinWeekly( | ||
public data class KotlinWeekly( | ||
override val id: String, | ||
override val title: String, | ||
override val publishTimestamp: String, | ||
override val publishTime: String, | ||
override val contentUrl: String, | ||
override val savedForLater: Boolean, | ||
val newsletterLogoUrl: String, | ||
) : FeedItem | ||
} |
4 changes: 2 additions & 2 deletions
4
...onMain/kotlin/io/github/reactivecircus/kstreamlined/kmp/data/feed/model/FeedOriginItem.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
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
Oops, something went wrong.