Skip to content

Commit

Permalink
Removed unused rootKeys parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
Gunter Hager committed Aug 1, 2017
1 parent 67c71c1 commit c247d1e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ReactiveCodable/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0.1</string>
<string>1.0.2</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
Expand Down
8 changes: 3 additions & 5 deletions ReactiveCodable/ReactiveCodable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,9 @@ extension SignalProtocol where Value == Data {
/// Maps the given JSON object within the stream to an object of given `type`.
///
/// - parameter type: The type of the object that should be returned
/// - parameter rootKeys: An array of keys that should be traversed in order to find a nested JSON object. The resulting object is subsequently used for further decoding.
///
/// - returns: A new Signal emitting the decoded object.
public func mapToType<T: Decodable>(_ type: T.Type, rootKeys: [String]? = nil) -> Signal<T, ReactiveCodableError> {
public func mapToType<T: Decodable>(_ type: T.Type) -> Signal<T, ReactiveCodableError> {
return signal
.mapError { ReactiveCodableError.underlying($0) }
.attemptMap { json -> Result<T, ReactiveCodableError> in
Expand All @@ -57,11 +56,10 @@ extension SignalProducerProtocol where Value == Data {
/// Maps the given JSON object within the stream to an object of given `type`
///
/// - parameter type: The type of the object that should be returned
/// - parameter rootKeys: An array of keys that should be traversed in order to find a nested JSON object. The resulting object is subsequently used for further decoding.
///
/// - returns: A new SignalProducer emitting the decoded object.
public func mapToType<T: Decodable>(_ type: T.Type, rootKeys: [String]? = nil) -> SignalProducer<T, ReactiveCodableError> {
return producer.lift { $0.mapToType(type, rootKeys: rootKeys) }
public func mapToType<T: Decodable>(_ type: T.Type) -> SignalProducer<T, ReactiveCodableError> {
return producer.lift { $0.mapToType(type) }
}

}
Expand Down

0 comments on commit c247d1e

Please sign in to comment.