From 817611cbb3a29835fc58fd127c0428ccf50033b3 Mon Sep 17 00:00:00 2001 From: Daniel Rees Date: Thu, 21 Nov 2019 12:48:20 -0500 Subject: [PATCH] Made isState accessors public --- Sources/client/Channel.swift | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/Sources/client/Channel.swift b/Sources/client/Channel.swift index c7b8631..483f546 100644 --- a/Sources/client/Channel.swift +++ b/Sources/client/Channel.swift @@ -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 } + }