Skip to content
This repository has been archived by the owner on Oct 14, 2021. It is now read-only.

Commit

Permalink
Rename noopDisconnection to noopDisconnect.
Browse files Browse the repository at this point in the history
Reviewers: chuga, O4 Material Apple platform reviewers, O2 Material Motion, #material_motion

Reviewed By: chuga, O4 Material Apple platform reviewers

Subscribers: chuga

Tags: #material_motion

Differential Revision: http://codereview.cc/D2242
  • Loading branch information
Jeff Verkoeyen committed Dec 13, 2016
1 parent 441707b commit 2ba6492
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ final class ValueObservable<T>: IndefiniteObservable<ValueObserver<T>> {
```swift
let observable = ValueObservable<<#ValueType#>> { observer in
observer.next(<#value#>)
return noopDisconnection
return noopDisconnect
}
```

Expand Down
2 changes: 1 addition & 1 deletion examples/OperatorExample.swift
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public class OperatorExampleViewController: UIViewController {
let motionStream = MotionObservable<Int> { observer in
observer.next(5)
observer.state(.atRest)
return noopDisconnection
return noopDisconnect
}

// Note that we avoid keeping a strong reference to self in the stream's operators.
Expand Down
8 changes: 4 additions & 4 deletions src/IndefiniteObservable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

let observable = IndefiniteObservable<Int> { observer in
observer.next(5)
return noopDisconnection
return noopDisconnect
}

let subscription = observable.subscribe { value in
Expand Down Expand Up @@ -99,14 +99,14 @@ public final class Subscription {
}

/**
A no-op disconnection that can be returned by connectors when there is no need for teardown.
A no-op disconnect block that can be returned by connectors when there is no need for teardown.

Example:

let observable = IndefiniteObservable<Int> { observer in
observer.next(5)

return noopDisconnection
return noopDisconnect
}
*/
public let noopDisconnection: Disconnect = { }
public let noopDisconnect: Disconnect = { }
12 changes: 6 additions & 6 deletions tests/unit/MemoryLeakTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class MemoryLeakTests: XCTestCase {
func testObservableIsDeallocated() {
var observable: ValueObservable<CGFloat>? = ValueObservable<CGFloat> { observer in
observer.next(5)
return noopDisconnection
return noopDisconnect
}
weak var weakObservable = observable

Expand All @@ -39,7 +39,7 @@ class MemoryLeakTests: XCTestCase {
func testDownstreamObservableKeepsUpstreamAlive() {
var observable: ValueObservable<CGFloat>? = ValueObservable<CGFloat> { observer in
observer.next(5)
return noopDisconnection
return noopDisconnect
}
weak var weakObservable = observable

Expand All @@ -58,7 +58,7 @@ class MemoryLeakTests: XCTestCase {
func testSubscribedObservableIsDeallocated() {
var observable: ValueObservable<CGFloat>? = ValueObservable<CGFloat> { observer in
observer.next(5)
return noopDisconnection
return noopDisconnect
}
weak var weakObservable = observable

Expand All @@ -78,7 +78,7 @@ class MemoryLeakTests: XCTestCase {
func testSubscribedObservableWithOperatorIsDeallocated() {
var observable: ValueObservable<CGFloat>? = ValueObservable<CGFloat> { observer in
observer.next(5)
return noopDisconnection
return noopDisconnect
}
weak var weakObservable = observable

Expand All @@ -102,7 +102,7 @@ class MemoryLeakTests: XCTestCase {
autoreleasepool {
let observable: ValueObservable<CGFloat>? = ValueObservable<CGFloat> { observer in
observer.next(5)
return noopDisconnection
return noopDisconnect
}
weakObservable = observable

Expand All @@ -128,7 +128,7 @@ class MemoryLeakTests: XCTestCase {
let value = 10
let observable = ValueObservable<Int> { observer in
observer.next(value)
return noopDisconnection
return noopDisconnect
}
weakObservable = observable

Expand Down
12 changes: 6 additions & 6 deletions tests/unit/ObservableTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class ObservableTests: XCTestCase {

let observable = ValueObservable<Int> { observer in
observer.next(value)
return noopDisconnection
return noopDisconnect
}

let wasReceived = expectation(description: "Value was received")
Expand Down Expand Up @@ -74,7 +74,7 @@ class ObservableTests: XCTestCase {

let observable = ValueObservable<Int> { observer in
observer.next(value)
return noopDisconnection
return noopDisconnect
}

let wasReceived = expectation(description: "Value was received")
Expand All @@ -99,7 +99,7 @@ class ObservableTests: XCTestCase {

let observable = ValueObservable<Int> { observer in
observer.next(value)
return noopDisconnection
return noopDisconnect
}

let wasReceived = expectation(description: "Value was received")
Expand All @@ -126,7 +126,7 @@ class ObservableTests: XCTestCase {
let value = 10
let observable = ValueObservable<Int> { observer in
observer.next(value)
return noopDisconnection
return noopDisconnect
}

let wasReceived = expectation(description: "Value was received")
Expand All @@ -143,7 +143,7 @@ class ObservableTests: XCTestCase {
let value = CGPoint(x: 0, y: 10)
let observable = ValueObservable<CGPoint> { observer in
observer.next(value)
return noopDisconnection
return noopDisconnect
}

let wasReceived = expectation(description: "Value was received")
Expand All @@ -161,7 +161,7 @@ class ObservableTests: XCTestCase {
let observable = ValueObservable<(Bool, CGPoint)> { observer in
observer.next(false, value)
observer.next(true, value)
return noopDisconnection
return noopDisconnect
}

var filteredValues: [CGPoint] = []
Expand Down

0 comments on commit 2ba6492

Please sign in to comment.