Skip to content

Commit 4080ab7

Browse files
committed
extend result builder
1 parent aa50e12 commit 4080ab7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Components/Sources/Common/Protocols/Editor.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public struct EditorBuilder<T: Editor> {
3535
Array(components.joined())
3636
}
3737

38-
// to use like if else
38+
// to use like if-else
3939

4040
public static func buildEither(first component: T) -> T {
4141
return component
@@ -44,4 +44,8 @@ public struct EditorBuilder<T: Editor> {
4444
public static func buildEither(second component: T) -> T {
4545
return component
4646
}
47+
48+
public static func buildOptional(_ component: [T]?) -> [T] {
49+
return []
50+
}
4751
}

0 commit comments

Comments
 (0)