Skip to content

Commit

Permalink
Merge pull request #151 from davidstump/dr/make-state-accessors-public
Browse files Browse the repository at this point in the history
Made isState accessors public
  • Loading branch information
dsrees authored Nov 21, 2019
2 parents 6635e06 + 817611c commit 932b037
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions Sources/client/Channel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -591,29 +591,37 @@ public class Channel {
var canPush: Bool {
return self.socket?.isConnected == true && self.isJoined
}
}


//----------------------------------------------------------------------
// MARK: - Public API
//----------------------------------------------------------------------
extension Channel {

/// - return: True if the Channel has been closed
var isClosed: Bool {
public var isClosed: Bool {
return state == .closed
}

/// - return: True if the Channel experienced an error
var isErrored: Bool {
public var isErrored: Bool {
return state == .errored
}

/// - return: True if the channel has joined
var isJoined: Bool {
public var isJoined: Bool {
return state == .joined
}

/// - return: True if the channel has requested to join
var isJoining: Bool {
public var isJoining: Bool {
return state == .joining
}

/// - return: True if the channel has requested to leave
var isLeaving: Bool {
public var isLeaving: Bool {
return state == .leaving
}

}

0 comments on commit 932b037

Please sign in to comment.