 
 import Foundation
 
-public protocol ComponentBuilderType: Hashable {
+// MARK: Component Builder
+
+public protocol ComponentBuilderType: Hashable, Equatable {
     // FIXME: do we really need Hashable?
     static var types: [Self: AnyClass] { get }
 }

    // TODO: need to make this API more clearly
    // used only for calculating cell's height manually
    private(set) var heightResolver: ManuallyFittingHeightResolver?

    public var hashValue: Int {
        return name.hashValue
    }

    public init(name: String, targetClass: AnyClass = UIView.self, nibName: String? = nil) {
        self.name = name

    }
}

// MARK: Helpers

public func ==<Builder: ComponentBuilderType>(lhs: ComponentTarget, rhs: Builder) -> Bool {
    return lhs.name == rhs.name
}

public func ==<Builder: ComponentBuilderType>(lhs: Builder, rhs: ComponentTarget) -> Bool {
    return lhs.name == rhs.name
}

// MARK: Adapt protocols

extension ComponentTarget: Equatable {}

public func ==(lhs: ComponentTarget, rhs: ComponentTarget) -> Bool {
    return lhs.name == rhs.name
}

extension ComponentTarget: Hashable {
    public var hashValue: Int {
        return name.hashValue
    }
}

