Skip to content

Commit

Permalink
Version 1.0.1 Bugfix. Relevant classes were not marked public, but ar…
Browse files Browse the repository at this point in the history
…e now.
  • Loading branch information
jakeHawkenGeocaching committed Oct 23, 2017
1 parent ec4a989 commit 31d34e8
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 28 deletions.
2 changes: 1 addition & 1 deletion Concurrency.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'Concurrency'
s.version = '1.0.0'
s.version = '1.0.1'
s.summary = 'A small toolkit for handling concurrency in Swift.'

s.description = <<-DESC
Expand Down
2 changes: 1 addition & 1 deletion Concurrency/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0.0</string>
<string>1.0.1</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
Expand Down
2 changes: 1 addition & 1 deletion Source/ConcurrencyHelpers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import Foundation


extension NSError {
public extension NSError {
static func cantMap<T,Q>(value:T, toType: Q.Type) -> NSError {
return CantMapError(value: value, toType: toType)
}
Expand Down
22 changes: 11 additions & 11 deletions Source/PeriodicFetcher.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import Foundation
import RxSwift


enum StreamState<T:Equatable>: Equatable {
public enum StreamState<T:Equatable>: Equatable {
case noData
case newData(T)
case error(Error)

static func ==(lhs: StreamState, rhs: StreamState) -> Bool {
public static func ==(lhs: StreamState, rhs: StreamState) -> Bool {
switch (lhs, rhs) {
case (.newData(let data1), .newData(let data2)):
return data1 == data2
Expand Down Expand Up @@ -45,10 +45,10 @@ enum StreamState<T:Equatable>: Equatable {

}

class PeriodicFetcher<T:Equatable> {
public class PeriodicFetcher<T:Equatable> {

typealias FutureGenerator = ()->(Future<T>)
typealias TimeIntervalGenerator = ()->(Double)
public typealias FutureGenerator = ()->(Future<T>)
public typealias TimeIntervalGenerator = ()->(Double)

//MARK: - PROPERTIES -
//MARK: private
Expand All @@ -72,7 +72,7 @@ class PeriodicFetcher<T:Equatable> {

//MARK: - public

internal var isFetching: Bool {
public var isFetching: Bool {
if let timer = timer {
return timer.isValid
}
Expand All @@ -89,25 +89,25 @@ class PeriodicFetcher<T:Equatable> {

//MARK: - PUBLIC METHODS

func observable() -> Observable<StreamState<T>> {
public func observable() -> Observable<StreamState<T>> {
return variable.asObservable()
}

internal func startPeriodicFetch() {
public func startPeriodicFetch() {
shouldEmit = true
if !isFetching || !timeIntervalIsCurrent {
createTimerAndFire()
}
}

func stopPeriodicFetch() {
public func stopPeriodicFetch() {
shouldEmit = false
currentFuture = nil
timer?.invalidate()
timer = nil
}

internal func fetchOnce() {
public func fetchOnce() {
shouldEmit = true
if isFetching {
if timeIntervalIsCurrent {
Expand Down Expand Up @@ -162,7 +162,7 @@ class PeriodicFetcher<T:Equatable> {
}
}

protocol PeriodicService {
public protocol PeriodicService {
associatedtype T: Equatable
func observable() -> Observable<StreamState<T>>
func startPeriodicFetch()
Expand Down
16 changes: 8 additions & 8 deletions Source/Promise.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import Foundation


class Promise<T> {
public class Promise<T> {

let future = Future<T>()

Expand All @@ -20,9 +20,9 @@ class Promise<T> {

}

class Future<T> {
typealias ThenBlock = (T)->()
typealias ErrorBlock = (Error)->()
public class Future<T> {
public typealias ThenBlock = (T)->()
public typealias ErrorBlock = (Error)->()

private var thenBlock: ThenBlock?
private var errorBlock: ErrorBlock?
Expand All @@ -36,7 +36,7 @@ class Future<T> {

//MARK: public properties

var value: T? {
public var value: T? {
guard let result = result else {
return nil
}
Expand All @@ -48,7 +48,7 @@ class Future<T> {
}
}

var error: Error? {
public var error: Error? {
guard let result = result else {
return nil
}
Expand Down Expand Up @@ -160,7 +160,7 @@ class Future<T> {
}
}

extension Future {
public extension Future {

public static func preResolved(value: T) -> Future<T> {
let future = Future<T>()
Expand Down Expand Up @@ -195,7 +195,7 @@ extension Future {

}

extension Future {
public extension Future {

public class func joining(_ futures:[Future<T>]) -> Future<[T]> {
return JoinedFuture(futures).future
Expand Down
12 changes: 6 additions & 6 deletions Source/Result.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
import Foundation


enum Result<T> {
public enum Result<T> {

typealias SuccessBlock = (T)->()
typealias ErrorBlock = (Error)->()
public typealias SuccessBlock = (T)->()
public typealias ErrorBlock = (Error)->()

case success(T)
case error(Error)
Expand Down Expand Up @@ -52,12 +52,12 @@ enum Result<T> {
return self.map(mapBlock).simple()
}

enum MapResult<Q>: Error, CustomStringConvertible {
public enum MapResult<Q>: Error, CustomStringConvertible {
case success(Q)
case originalError(Error)
case mappingError(T)

var description: String {
public var description: String {
switch self {
case .success:
return "success"
Expand All @@ -68,7 +68,7 @@ enum Result<T> {
}
}

func simple() -> Result<Q> {
public func simple() -> Result<Q> {
switch self {
case .success(let value):
return .success(value)
Expand Down

0 comments on commit 31d34e8

Please sign in to comment.