-
Notifications
You must be signed in to change notification settings - Fork 13
Automatically inject options into Channel #24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
baf7561
62994dc
3a77283
bf3d18e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -583,7 +583,24 @@ public class RealtimeClient: TransportDelegate { | |
// ---------------------------------------------------------------------- | ||
|
||
// MARK: - Channel Initialization | ||
|
||
// ---------------------------------------------------------------------- | ||
/// Initialize a new Channel | ||
/// | ||
/// Example: | ||
/// | ||
/// let channel = socket.channel("rooms", options: ChannelOptions(presenceKey: "user123")) | ||
/// | ||
/// - parameter topic: Topic of the channel | ||
/// - parameter options: Optional. Options for the channel | ||
/// - return: A new channel | ||
public func channel( | ||
_ topic: ChannelTopic, | ||
options: ChannelOptions = ChannelOptions() | ||
) -> Channel { | ||
let channel = Channel(topic: topic, options: options, socket: self) | ||
channels.append(channel) | ||
return channel | ||
} | ||
// ---------------------------------------------------------------------- | ||
/// Initialize a new Channel | ||
/// | ||
|
@@ -594,9 +611,10 @@ public class RealtimeClient: TransportDelegate { | |
/// - parameter topic: Topic of the channel | ||
/// - parameter params: Optional. Parameters for the channel | ||
/// - return: A new channel | ||
@available(*, deprecated, renamed: "channel(_:options:)") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should we really deprecate this? aren't there other params that can be passed other than I'm not sure about this because I'm not used to the realtime feature, what do you think @foodisbeast ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unless this package is meant to support Phoenix realtime generally, supabase realtime or import { createClient } from '@supabase/supabase-js'
const channelC = supabase.channel('test', {
config: {
presence: {
key: 'userId-123',
},
},
}) |
||
public func channel( | ||
_ topic: ChannelTopic, | ||
params: [String: Any] = [:] | ||
params: [String: Any] | ||
) -> Channel { | ||
let channel = Channel(topic: topic, params: params, socket: self) | ||
channels.append(channel) | ||
|
Uh oh!
There was an error while loading. Please reload this page.