Skip to content

Commit 583f4b8

Browse files
committed
feat: API improvements
1 parent 1b69b2d commit 583f4b8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Sources/FunctionalClosures/DataSource.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ public class DataSource<Input, Output> {
2929
public func callAsFunction(_ input: Input) -> Output? {
3030
projectedValue(input)
3131
}
32+
33+
public func callAsFunction() where Input == Void {
34+
projectedValue(())
35+
}
3236
}
3337

3438

@@ -67,4 +71,8 @@ public class OptionalDataSource<Input, Output> {
6771
public func callAsFunction(_ input: Input) -> Output? {
6872
projectedValue?(input)
6973
}
74+
75+
public func callAsFunction() where Input == Void {
76+
projectedValue?(())
77+
}
7078
}

0 commit comments

Comments
 (0)