Merge branch 'feature/DE307-834' into 'develop'
Digital PCT265 story DE307-834: Increase throttle time for collision safety.... ### Summary Badge isEqual implementation. ### JIRA Ticket https://onejira.verizon.com/browse/DE307-834 Co-authored-by: Hedden, Kyle Matthew <kyle.hedden@verizonwireless.com> See merge request https://gitlab.verizon.com/BPHV_MIPS/mvm_core_ui/-/merge_requests/1146
This commit is contained in:
commit
c77f0c6837
@ -53,4 +53,15 @@ open class BadgeModel: MoleculeModelProtocol {
|
||||
try container.encode(numberOfLines, forKey: .numberOfLines)
|
||||
try container.encodeIfPresent(maxWidth, forKey: .maxWidth)
|
||||
}
|
||||
|
||||
public func isEqual(to model: any ModelComparisonProtocol) -> Bool {
|
||||
guard let model = model as? BadgeModel else { return false }
|
||||
return self.backgroundColor == model.backgroundColor
|
||||
&& self.fillColor == model.fillColor
|
||||
&& self.numberOfLines == model.numberOfLines
|
||||
&& self.text == model.text
|
||||
&& self.surface == model.surface
|
||||
&& self.accessibilityText == model.accessibilityText
|
||||
&& self.maxWidth == model.maxWidth
|
||||
}
|
||||
}
|
||||
|
||||
@ -78,7 +78,7 @@ import Combine
|
||||
return (next.0 ?? accumulator.0, next.1 ?? accumulator.1, next.2?.mergingRight(accumulator.2 ?? [:]))
|
||||
}
|
||||
// Delay allowing the previous model update to settle before triggering a re-render.
|
||||
.throttle(for: .seconds(0.05), scheduler: RunLoop.main, latest: true)
|
||||
.throttle(for: .seconds(0.25), scheduler: RunLoop.main, latest: true)
|
||||
.sink { [weak self] (pageUpdates: [String : Any]?, pageModel: PageModelProtocol?, moduleUpdates: [String : Any]?) in
|
||||
guard let self = self else { return }
|
||||
if let pageUpdates, pageModel != nil {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user