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 Foundation
|
||||||
import Combine
|
import Combine
|
||||||
|
|
||||||
public protocol ModelHandlerable: AnyObject {
|
public protocol ModelHandlerable: AnyObject, Initable {
|
||||||
associatedtype ModelType: Modelable
|
associatedtype ModelType: Modelable
|
||||||
var model: ModelType { get set }
|
var model: ModelType { get set }
|
||||||
var modelPublisher: Published<ModelType>.Publisher { get }
|
var modelPublisher: Published<ModelType>.Publisher { get }
|
||||||
@ -20,6 +20,9 @@ public protocol ModelHandlerable: AnyObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
extension ModelHandlerable {
|
extension ModelHandlerable {
|
||||||
|
public init() {
|
||||||
|
self.init(with: ModelType())
|
||||||
|
}
|
||||||
|
|
||||||
public func set(with model: ModelType) {
|
public func set(with model: ModelType) {
|
||||||
if shouldUpdateView(viewModel: model){
|
if shouldUpdateView(viewModel: model){
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user