Skip to content

Commit 991ff80

Browse files
committed
Rename _action to _send.
1 parent 741c66d commit 991ff80

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

Sources/Observer.swift

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ extension Signal {
1111
/// (typically from a Signal).
1212
public final class Observer {
1313
public typealias Action = (Event) -> Void
14-
private let _action: Action
14+
private let _send: Action
1515

1616
/// An action that will be performed upon arrival of the event.
1717
@available(*, deprecated: 2.0, renamed:"send(_:)")
1818
public var action: Action {
1919
guard !interruptsOnDeinit && wrapped == nil else {
20-
return { self._action($0) }
20+
return { self._send($0) }
2121
}
22-
return _action
22+
return _send
2323
}
2424

2525
/// Whether the observer should send an `interrupted` event as it deinitializes.
@@ -47,9 +47,9 @@ extension Signal {
4747
) {
4848
var hasDeliveredTerminalEvent = false
4949

50-
self._action = transform { event in
50+
self._send = transform { event in
5151
if !hasDeliveredTerminalEvent {
52-
observer._action(event)
52+
observer._send(event)
5353

5454
if event.isTerminating {
5555
hasDeliveredTerminalEvent = true
@@ -70,7 +70,7 @@ extension Signal {
7070
/// - interruptsOnDeinit: `true` if the observer should send an `interrupted`
7171
/// event as it deinitializes. `false` otherwise.
7272
internal init(action: @escaping Action, interruptsOnDeinit: Bool) {
73-
self._action = action
73+
self._send = action
7474
self.wrapped = nil
7575
self.interruptsOnDeinit = interruptsOnDeinit
7676
}
@@ -81,7 +81,7 @@ extension Signal {
8181
/// - parameters:
8282
/// - action: A closure to lift over received event.
8383
public init(_ action: @escaping Action) {
84-
self._action = action
84+
self._send = action
8585
self.wrapped = nil
8686
self.interruptsOnDeinit = false
8787
}
@@ -135,39 +135,39 @@ extension Signal {
135135
// Since `Signal` would ensure that only one terminal event would ever be
136136
// sent for any given `Signal`, we do not need to assert any condition
137137
// here.
138-
_action(.interrupted)
138+
_send(.interrupted)
139139
}
140140
}
141141

142142
/// Puts an event into `self`.
143143
public func send(_ event: Event) {
144-
_action(event)
144+
_send(event)
145145
}
146146

147147
/// Puts a `value` event into `self`.
148148
///
149149
/// - parameters:
150150
/// - value: A value sent with the `value` event.
151151
public func send(value: Value) {
152-
_action(.value(value))
152+
_send(.value(value))
153153
}
154154

155155
/// Puts a failed event into `self`.
156156
///
157157
/// - parameters:
158158
/// - error: An error object sent with failed event.
159159
public func send(error: Error) {
160-
_action(.failed(error))
160+
_send(.failed(error))
161161
}
162162

163163
/// Puts a `completed` event into `self`.
164164
public func sendCompleted() {
165-
_action(.completed)
165+
_send(.completed)
166166
}
167167

168168
/// Puts an `interrupted` event into `self`.
169169
public func sendInterrupted() {
170-
_action(.interrupted)
170+
_send(.interrupted)
171171
}
172172
}
173173
}

0 commit comments

Comments
 (0)