Correct mixed indentation by replacing tabs with spaces

This commit is contained in:
Eric Jensen 2016-03-22 20:04:39 -07:00
parent 6df77da474
commit 2b0dd31a9f
6 changed files with 254 additions and 254 deletions

View File

@ -17,15 +17,15 @@ var rx_tap_key: UInt8 = 0
extension UIBarButtonItem {
/**
Bindable sink for `enabled` property.
*/
public var rx_enabled: AnyObserver<Bool> {
/**
Bindable sink for `enabled` property.
*/
public var rx_enabled: AnyObserver<Bool> {
return UIBindingObserver(UIElement: self) { UIElement, value in
UIElement.enabled = value
}.asObserver()
}
}.asObserver()
}
/**
Reactive wrapper for target action pattern on `self`.
*/

View File

@ -20,7 +20,7 @@ extension UIButton {
Reactive wrapper for `TouchUpInside` control event.
*/
public var rx_tap: ControlEvent<Void> {
return rx_controlEvent(.TouchUpInside)
return rx_controlEvent(.TouchUpInside)
}
}

View File

@ -23,11 +23,11 @@ protocol ImageService {
}
class DefaultImageService: ImageService {
static let sharedImageService = DefaultImageService() // Singleton
let $: Dependencies = Dependencies.sharedDependencies
static let sharedImageService = DefaultImageService() // Singleton
let $: Dependencies = Dependencies.sharedDependencies
// 1st level cache
private let _imageCache = NSCache()

View File

@ -92,21 +92,21 @@ extension ObservableType {
-> ConnectableObservable<E> {
return self.multicast(ReplaySubject.create(bufferSize: bufferSize))
}
/**
Returns a connectable observable sequence that shares a single subscription to the underlying sequence replaying all elements.
This operator is a specialization of `multicast` using a `ReplaySubject`.
/**
Returns a connectable observable sequence that shares a single subscription to the underlying sequence replaying all elements.
This operator is a specialization of `multicast` using a `ReplaySubject`.
- seealso: [replay operator on reactivex.io](http://reactivex.io/documentation/operators/replay.html)
- returns: A connectable observable sequence that shares a single subscription to the underlying sequence.
*/
@warn_unused_result(message="http://git.io/rxs.uo")
public func replayAll()
-> ConnectableObservable<E> {
- returns: A connectable observable sequence that shares a single subscription to the underlying sequence.
*/
@warn_unused_result(message="http://git.io/rxs.uo")
public func replayAll()
-> ConnectableObservable<E> {
return self.multicast(ReplaySubject.createUnbounded())
}
}
}
// MARK: refcount

View File

@ -62,15 +62,15 @@ public class ReplaySubject<Element>
return ReplayMany(bufferSize: bufferSize)
}
}
/**
Creates a new instance of `ReplaySubject` that buffers all the elements of a sequence.
To avoid filling up memory, developer needs to make sure that the use case will only ever store a 'reasonable'
number of elements.
*/
public static func createUnbounded() -> ReplaySubject<Element> {
return ReplayAll()
}
/**
Creates a new instance of `ReplaySubject` that buffers all the elements of a sequence.
To avoid filling up memory, developer needs to make sure that the use case will only ever store a 'reasonable'
number of elements.
*/
public static func createUnbounded() -> ReplaySubject<Element> {
return ReplayAll()
}
}
class ReplayBufferBase<Element>

View File

@ -676,227 +676,227 @@ extension ObservableBindingTest {
Subscription(650, 800),
])
}
func testReplayAll_Basic() {
let scheduler = TestScheduler(initialClock: 0)
let xs = scheduler.createHotObservable([
next(110, 7),
next(220, 3),
next(280, 4),
next(290, 1),
next(340, 8),
next(360, 5),
next(370, 6),
next(390, 7),
next(410, 13),
next(430, 2),
next(450, 9),
next(520, 11),
next(560, 20),
error(600, testError)
])
var ys: ConnectableObservable<Int>! = nil
var subscription: Disposable! = nil
var connection: Disposable! = nil
let res = scheduler.createObserver(Int)
scheduler.scheduleAt(Defaults.created) { ys = xs.replayAll() }
scheduler.scheduleAt(450, action: { subscription = ys.subscribe(res) })
scheduler.scheduleAt(Defaults.disposed) { subscription.dispose() }
scheduler.scheduleAt(200) { connection = ys.connect() }
scheduler.scheduleAt(400) { connection.dispose() }
scheduler.scheduleAt(500) { connection = ys.connect() }
scheduler.scheduleAt(550) { connection.dispose() }
scheduler.scheduleAt(650) { connection = ys.connect() }
scheduler.scheduleAt(800) { connection.dispose() }
scheduler.start()
XCTAssertEqual(res.events, [
next(450, 3),
next(450, 4),
next(450, 1),
next(450, 8),
next(450, 5),
next(450, 6),
next(450, 7),
next(520, 11),
])
XCTAssertEqual(xs.subscriptions, [
Subscription(200, 400),
Subscription(500, 550),
Subscription(650, 800)
])
}
func testReplayAll_Error() {
let scheduler = TestScheduler(initialClock: 0)
let xs = scheduler.createHotObservable([
next(110, 7),
next(220, 3),
next(280, 4),
next(290, 1),
next(340, 8),
next(360, 5),
next(370, 6),
next(390, 7),
next(410, 13),
next(430, 2),
next(450, 9),
next(520, 11),
next(560, 20),
error(600, testError)
])
var ys: ConnectableObservable<Int>! = nil
var subscription: Disposable! = nil
var connection: Disposable! = nil
let res = scheduler.createObserver(Int)
scheduler.scheduleAt(Defaults.created) { ys = xs.replayAll() }
scheduler.scheduleAt(450, action: { subscription = ys.subscribe(res) })
scheduler.scheduleAt(Defaults.disposed) { subscription.dispose() }
scheduler.scheduleAt(300) { connection = ys.connect() }
scheduler.scheduleAt(400) { connection.dispose() }
scheduler.scheduleAt(500) { connection = ys.connect() }
scheduler.scheduleAt(800) { connection.dispose() }
scheduler.start()
XCTAssertEqual(res.events, [
next(450, 8),
next(450, 5),
next(450, 6),
next(450, 7),
next(520, 11),
next(560, 20),
error(600, testError),
])
XCTAssertEqual(xs.subscriptions, [
Subscription(300, 400),
Subscription(500, 600),
])
}
func testReplayAll_Complete() {
let scheduler = TestScheduler(initialClock: 0)
let xs = scheduler.createHotObservable([
next(110, 7),
next(220, 3),
next(280, 4),
next(290, 1),
next(340, 8),
next(360, 5),
next(370, 6),
next(390, 7),
next(410, 13),
next(430, 2),
next(450, 9),
next(520, 11),
next(560, 20),
completed(600)
])
var ys: ConnectableObservable<Int>! = nil
var subscription: Disposable! = nil
var connection: Disposable! = nil
let res = scheduler.createObserver(Int)
scheduler.scheduleAt(Defaults.created) { ys = xs.replayAll() }
scheduler.scheduleAt(450, action: { subscription = ys.subscribe(res) })
scheduler.scheduleAt(Defaults.disposed) { subscription.dispose() }
scheduler.scheduleAt(300) { connection = ys.connect() }
scheduler.scheduleAt(400) { connection.dispose() }
scheduler.scheduleAt(500) { connection = ys.connect() }
scheduler.scheduleAt(800) { connection.dispose() }
scheduler.start()
XCTAssertEqual(res.events, [
next(450, 8),
next(450, 5),
next(450, 6),
next(450, 7),
next(520, 11),
next(560, 20),
completed(600)
])
XCTAssertEqual(xs.subscriptions, [
Subscription(300, 400),
Subscription(500, 600),
])
}
func testReplayAll_Dispose() {
let scheduler = TestScheduler(initialClock: 0)
let xs = scheduler.createHotObservable([
next(110, 7),
next(220, 3),
next(280, 4),
next(290, 1),
next(340, 8),
next(360, 5),
next(370, 6),
next(390, 7),
next(410, 13),
next(430, 2),
next(450, 9),
next(520, 11),
next(560, 20),
completed(600)
])
var ys: ConnectableObservable<Int>! = nil
var subscription: Disposable! = nil
var connection: Disposable! = nil
let res = scheduler.createObserver(Int)
scheduler.scheduleAt(Defaults.created) { ys = xs.replayAll() }
scheduler.scheduleAt(450, action: { subscription = ys.subscribe(res) })
scheduler.scheduleAt(475) { subscription.dispose() }
scheduler.scheduleAt(250) { connection = ys.connect() }
scheduler.scheduleAt(400) { connection.dispose() }
scheduler.scheduleAt(500) { connection = ys.connect() }
scheduler.scheduleAt(550) { connection.dispose() }
scheduler.scheduleAt(650) { connection = ys.connect() }
scheduler.scheduleAt(800) { connection.dispose() }
scheduler.start()
XCTAssertEqual(res.events, [
next(450, 4),
next(450, 1),
next(450, 8),
next(450, 5),
next(450, 6),
next(450, 7),
])
XCTAssertEqual(xs.subscriptions, [
Subscription(250, 400),
Subscription(500, 550),
Subscription(650, 800),
])
}
func testReplayAll_Basic() {
let scheduler = TestScheduler(initialClock: 0)
let xs = scheduler.createHotObservable([
next(110, 7),
next(220, 3),
next(280, 4),
next(290, 1),
next(340, 8),
next(360, 5),
next(370, 6),
next(390, 7),
next(410, 13),
next(430, 2),
next(450, 9),
next(520, 11),
next(560, 20),
error(600, testError)
])
var ys: ConnectableObservable<Int>! = nil
var subscription: Disposable! = nil
var connection: Disposable! = nil
let res = scheduler.createObserver(Int)
scheduler.scheduleAt(Defaults.created) { ys = xs.replayAll() }
scheduler.scheduleAt(450, action: { subscription = ys.subscribe(res) })
scheduler.scheduleAt(Defaults.disposed) { subscription.dispose() }
scheduler.scheduleAt(200) { connection = ys.connect() }
scheduler.scheduleAt(400) { connection.dispose() }
scheduler.scheduleAt(500) { connection = ys.connect() }
scheduler.scheduleAt(550) { connection.dispose() }
scheduler.scheduleAt(650) { connection = ys.connect() }
scheduler.scheduleAt(800) { connection.dispose() }
scheduler.start()
XCTAssertEqual(res.events, [
next(450, 3),
next(450, 4),
next(450, 1),
next(450, 8),
next(450, 5),
next(450, 6),
next(450, 7),
next(520, 11),
])
XCTAssertEqual(xs.subscriptions, [
Subscription(200, 400),
Subscription(500, 550),
Subscription(650, 800)
])
}
func testReplayAll_Error() {
let scheduler = TestScheduler(initialClock: 0)
let xs = scheduler.createHotObservable([
next(110, 7),
next(220, 3),
next(280, 4),
next(290, 1),
next(340, 8),
next(360, 5),
next(370, 6),
next(390, 7),
next(410, 13),
next(430, 2),
next(450, 9),
next(520, 11),
next(560, 20),
error(600, testError)
])
var ys: ConnectableObservable<Int>! = nil
var subscription: Disposable! = nil
var connection: Disposable! = nil
let res = scheduler.createObserver(Int)
scheduler.scheduleAt(Defaults.created) { ys = xs.replayAll() }
scheduler.scheduleAt(450, action: { subscription = ys.subscribe(res) })
scheduler.scheduleAt(Defaults.disposed) { subscription.dispose() }
scheduler.scheduleAt(300) { connection = ys.connect() }
scheduler.scheduleAt(400) { connection.dispose() }
scheduler.scheduleAt(500) { connection = ys.connect() }
scheduler.scheduleAt(800) { connection.dispose() }
scheduler.start()
XCTAssertEqual(res.events, [
next(450, 8),
next(450, 5),
next(450, 6),
next(450, 7),
next(520, 11),
next(560, 20),
error(600, testError),
])
XCTAssertEqual(xs.subscriptions, [
Subscription(300, 400),
Subscription(500, 600),
])
}
func testReplayAll_Complete() {
let scheduler = TestScheduler(initialClock: 0)
let xs = scheduler.createHotObservable([
next(110, 7),
next(220, 3),
next(280, 4),
next(290, 1),
next(340, 8),
next(360, 5),
next(370, 6),
next(390, 7),
next(410, 13),
next(430, 2),
next(450, 9),
next(520, 11),
next(560, 20),
completed(600)
])
var ys: ConnectableObservable<Int>! = nil
var subscription: Disposable! = nil
var connection: Disposable! = nil
let res = scheduler.createObserver(Int)
scheduler.scheduleAt(Defaults.created) { ys = xs.replayAll() }
scheduler.scheduleAt(450, action: { subscription = ys.subscribe(res) })
scheduler.scheduleAt(Defaults.disposed) { subscription.dispose() }
scheduler.scheduleAt(300) { connection = ys.connect() }
scheduler.scheduleAt(400) { connection.dispose() }
scheduler.scheduleAt(500) { connection = ys.connect() }
scheduler.scheduleAt(800) { connection.dispose() }
scheduler.start()
XCTAssertEqual(res.events, [
next(450, 8),
next(450, 5),
next(450, 6),
next(450, 7),
next(520, 11),
next(560, 20),
completed(600)
])
XCTAssertEqual(xs.subscriptions, [
Subscription(300, 400),
Subscription(500, 600),
])
}
func testReplayAll_Dispose() {
let scheduler = TestScheduler(initialClock: 0)
let xs = scheduler.createHotObservable([
next(110, 7),
next(220, 3),
next(280, 4),
next(290, 1),
next(340, 8),
next(360, 5),
next(370, 6),
next(390, 7),
next(410, 13),
next(430, 2),
next(450, 9),
next(520, 11),
next(560, 20),
completed(600)
])
var ys: ConnectableObservable<Int>! = nil
var subscription: Disposable! = nil
var connection: Disposable! = nil
let res = scheduler.createObserver(Int)
scheduler.scheduleAt(Defaults.created) { ys = xs.replayAll() }
scheduler.scheduleAt(450, action: { subscription = ys.subscribe(res) })
scheduler.scheduleAt(475) { subscription.dispose() }
scheduler.scheduleAt(250) { connection = ys.connect() }
scheduler.scheduleAt(400) { connection.dispose() }
scheduler.scheduleAt(500) { connection = ys.connect() }
scheduler.scheduleAt(550) { connection.dispose() }
scheduler.scheduleAt(650) { connection = ys.connect() }
scheduler.scheduleAt(800) { connection.dispose() }
scheduler.start()
XCTAssertEqual(res.events, [
next(450, 4),
next(450, 1),
next(450, 8),
next(450, 5),
next(450, 6),
next(450, 7),
])
XCTAssertEqual(xs.subscriptions, [
Subscription(250, 400),
Subscription(500, 550),
Subscription(650, 800),
])
}
}