Skip to content

Commit 793f0a2

Browse files
committed
removing bad pattern of not saving sink to a meaningful variable
1 parent 1d08c06 commit 793f0a2

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

docs/pattern-test-subscriber-subject.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ func testSinkReceiveDataThenError() {
6565
// setup
6666
let simplePublisher = PassthroughSubject<String, Error>() <2>
6767
68-
let _ = simplePublisher <3>
68+
let cancellable = simplePublisher <3>
6969
.sink(receiveCompletion: { completion in
7070
countCompletionsReceived += 1
7171
switch completion { <4>

docs/using-combine-book.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
= Using Combine
22
Joseph Heck
3-
v 1.2.1, 2021-12-21
3+
v 1.2.2, 2021-05-24
44
:doctype: book
55
:creator: {author}
66
:producer: Joseph Heck
77
:keywords: Apple, Combine, ReactiveX, SwiftUI
8-
:copyright: Joseph Heck 2019-2021
8+
:copyright: Joseph Heck 2019-2022
99
:publication-type: book
1010
// NOTE use 'anthology' for per-chapter author support
1111
:idprefix:

docs_zh-CN/pattern-test-subscriber-subject.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ func testSinkReceiveDataThenError() {
6565
// setup
6666
let simplePublisher = PassthroughSubject<String, Error>() <2>
6767
68-
let _ = simplePublisher <3>
68+
let cancellable = simplePublisher <3>
6969
.sink(receiveCompletion: { completion in
7070
countCompletionsReceived += 1
7171
switch completion { <4>

docs_zh-CN/using-combine_zh-CN.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
= Using Combine
22
Joseph Heck
3-
v 1.2.1, 2021-12-21
3+
v 1.2.2, 2021-05-24
44
:doctype: book
55
:creator: {author}
66
:producer: Joseph Heck
77
:keywords: Apple, Combine, ReactiveX, SwiftUI
8-
:copyright: Joseph Heck 2019-2021
8+
:copyright: Joseph Heck 2019-2022
99
:publication-type: book
1010
// NOTE use 'anthology' for per-chapter author support
1111
:idprefix:

0 commit comments

Comments
 (0)