This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright © 2019 Ooma Inc. All rights reserved. | |
import Foundation | |
import RIBs | |
import RxSwift | |
// MARK: - Plugin | |
public protocol Plugin: AnyObject { | |
associatedtype Component = Dependency |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
private let errorDebugDescriptionCreateBlock: (String, ContentRepresentable & IntCodeRepresentable & LocalizedErrorRepresentable) -> String = { name, error in | |
return """ | |
=== Self is \(name) === | |
Code: \(error.code) \r | |
errorDescription: \(String(describing: error.asLocalizedError?.errorDescription)) \r | |
failureReason: \(String(describing: error.asLocalizedError?.failureReason)) \r | |
recoverySuggestion: \(String(describing: error.asLocalizedError?.recoverySuggestion)) \r |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Combine | |
import Foundation | |
// MARK: - Typealiases | |
public typealias Seal<A, B: Error> = AnyPublisher<A, B> | |
// MARK: - Error | |
public enum DataSourceError: Error { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
@resultBuilder | |
public struct ArrayBuilder<T> { | |
public static func buildBlock() -> [T] { [] } | |
public static func buildExpression(_ expression: T) -> [T] { [expression] } | |
public static func buildExpression(_ expression: T...) -> [T] { expression } | |
public static func buildExpression(_ expression: T?...) -> [T] { expression.compactMap { $0 } } | |
public static func buildExpression(_ expression: T?) -> [T] { [expression].compactMap { $0 } } | |
public static func buildExpression(_ expression: [T]) -> [T] { expression } |