-
-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #831 from supabase-community/realtime-channel
Improve behavior for realtime channel creation and improve docs
- Loading branch information
Showing
8 changed files
with
85 additions
and
25 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
12 changes: 12 additions & 0 deletions
12
Realtime/src/commonMain/kotlin/io/github/jan/supabase/realtime/RealtimeTopic.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,12 @@ | ||
package io.github.jan.supabase.realtime | ||
|
||
@PublishedApi | ||
internal object RealtimeTopic { | ||
|
||
const val PREFIX = "realtime" | ||
|
||
fun withChannelId(channelId: String): String { | ||
return "$PREFIX:$channelId" | ||
} | ||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import io.github.jan.supabase.realtime.RealtimeTopic | ||
import kotlin.test.Test | ||
import kotlin.test.assertEquals | ||
|
||
class RealtimeTopicTest { | ||
|
||
@Test | ||
fun testRealtimeTopic() { | ||
val channelId = "channelId" | ||
val topic = RealtimeTopic.withChannelId(channelId) | ||
assertEquals("realtime:channelId", topic) | ||
} | ||
|
||
@Test | ||
fun testRealtimePrefix() { | ||
assertEquals("realtime", RealtimeTopic.PREFIX) | ||
} | ||
|
||
} |