added init
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
cfecae528b
commit
0b643034f6
@ -8,7 +8,7 @@
|
||||
import Foundation
|
||||
import Combine
|
||||
|
||||
public protocol ModelHandlerable: AnyObject {
|
||||
public protocol ModelHandlerable: AnyObject, Initable {
|
||||
associatedtype ModelType: Modelable
|
||||
var model: ModelType { get set }
|
||||
var modelPublisher: Published<ModelType>.Publisher { get }
|
||||
@ -20,6 +20,9 @@ public protocol ModelHandlerable: AnyObject {
|
||||
}
|
||||
|
||||
extension ModelHandlerable {
|
||||
public init() {
|
||||
self.init(with: ModelType())
|
||||
}
|
||||
|
||||
public func set(with model: ModelType) {
|
||||
if shouldUpdateView(viewModel: model){
|
||||
|
||||
Loading…
Reference in New Issue
Block a user