Skip to content
This repository has been archived by the owner on Sep 7, 2021. It is now read-only.

Conforms Array to CorvusResponse #33

Merged
merged 1 commit into from
Apr 23, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Sources/Corvus/Endpoints/Utilities/Array+CorvusResponse.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/// Allows ResponseModifier to work with Arrays of `CorvusResponse`
///
/// Instead of returning a single `CorvusResponse` an array of `CorvusResponse`
/// can be returned instead.
extension Array: CorvusResponse where Element: CorvusResponse {
public init(item: [Element.Item]) {
self = item.map { Element(item: $0) }
}
}