Skip to content

Commit 2fbc5ef

Browse files
committed
Changes for ReactiveSwift
1 parent 425e921 commit 2fbc5ef

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

Sources/ComposableArchitecture/ViewStore.swift

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -102,31 +102,27 @@ public final class ViewStore<State, Action> {
102102
}
103103
}
104104

105-
/// A publisher that emits when state changes.
105+
/// A `SignalProducerConvertible` that emits when state changes.
106106
///
107-
/// This publisher supports dynamic member lookup so that you can pluck out a specific field in
107+
/// This producer supports dynamic member lookup so that you can pluck out a specific field in
108108
/// the state:
109109
///
110110
/// ```swift
111-
/// viewStore.publisher.alert
112-
/// .sink { ... }
111+
/// viewStore.produced.alert
112+
/// .startWithValues { ... }
113113
/// ```
114114
///
115115
/// When the emission happens the ``ViewStore``'s state has been updated, and so the following
116116
/// precondition will pass:
117117
///
118118
/// ```swift
119-
/// viewStore.publisher
120-
/// .sink { precondition($0 == viewStore.state) }
119+
/// viewStore.produced.producer
120+
/// .startWithValues { precondition($0 == viewStore.state) }
121121
/// ```
122122
///
123123
/// This means you can either use the value passed to the closure or you can reach into
124124
/// `viewStore.state` directly.
125125
///
126-
/// - Note: Due to a bug in Combine (or feature?), the order you `.sink` on a publisher has no
127-
/// bearing on the order the `.sink` closures are called. This means the work performed inside
128-
/// `viewStore.publisher.sink` closures should be completely independent of each other.
129-
/// Later closures cannot assume that earlier ones have already run.
130126
public var produced: StoreProducer<State> {
131127
StoreProducer(viewStore: self)
132128
}

0 commit comments

Comments
 (0)