Skip to content

Commit 0cb81fc

Browse files
committed
feat: API improvements
1 parent 64db5d4 commit 0cb81fc

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

Sources/FunctionalClosures/DataSource.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ public class DataSource<Input, Output> {
66
public struct Container {
77
internal var action: ((Input) -> Output)
88

9-
public init(handler: @escaping (Input) -> Output) {
10-
self.action = handler
9+
public init(action: @escaping (Input) -> Output) {
10+
self.action = action
1111
}
1212

1313
public mutating func callAsFunction(perform action: @escaping (Input) -> Output) {
@@ -42,8 +42,8 @@ public class OptionalDataSource<Input, Output> {
4242

4343
internal init() {}
4444

45-
public init(handler: ((Input) -> Output)?) {
46-
self.action = handler
45+
public init(action: ((Input) -> Output)?) {
46+
self.action = action
4747
}
4848

4949
public mutating func callAsFunction(perform action: ((Input) -> Output)?) {

Sources/FunctionalClosures/Handler.swift

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ public class Handler<Input> {
99

1010
internal init() {}
1111

12-
public init(handler: ((Input) -> Void)?) {
13-
self.action = handler
12+
public init(action: ((Input) -> Void)?) {
13+
self.action = action
1414
}
1515

1616
public mutating func callAsFunction(action: ((Input) -> Void)?) {
@@ -79,8 +79,8 @@ public class Handler2<T0, T1> {
7979

8080
internal init() {}
8181

82-
public init(handler: ((T0, T1) -> Void)?) {
83-
self.action = handler
82+
public init(action: ((T0, T1) -> Void)?) {
83+
self.action = action
8484
}
8585

8686
public mutating func callAsFunction(action: ((T0, T1) -> Void)?) {
@@ -147,8 +147,8 @@ public class Handler3<T0, T1, T2> {
147147

148148
internal init() {}
149149

150-
public init(handler: ((T0, T1, T2) -> Void)?) {
151-
self.action = handler
150+
public init(action: ((T0, T1, T2) -> Void)?) {
151+
self.action = action
152152
}
153153

154154
public mutating func callAsFunction(action: ((T0, T1, T2) -> Void)?) {
@@ -215,8 +215,8 @@ public class Handler4<T0, T1, T2, T3> {
215215

216216
internal init() {}
217217

218-
public init(handler: ((T0, T1, T2, T3) -> Void)?) {
219-
self.action = handler
218+
public init(action: ((T0, T1, T2, T3) -> Void)?) {
219+
self.action = action
220220
}
221221

222222
public mutating func callAsFunction(action: ((T0, T1, T2, T3) -> Void)?) {
@@ -283,8 +283,8 @@ public class Handler5<T0, T1, T2, T3, T4> {
283283

284284
internal init() {}
285285

286-
public init(handler: ((T0, T1, T2, T3, T4) -> Void)?) {
287-
self.action = handler
286+
public init(action: ((T0, T1, T2, T3, T4) -> Void)?) {
287+
self.action = action
288288
}
289289

290290
public mutating func callAsFunction(action: ((T0, T1, T2, T3, T4) -> Void)?) {

0 commit comments

Comments
 (0)