сделать пожалуйста:
Пишем на swift.
Реализуй протокол Equatable, а именно метод public static func == (
lhs: Ostin_test.Basket2Mutation,
rhs: Ostin_test.Basket2Mutation
) -> Bool для сущности
enum Basket2Mutation {
case setIsLoading(_ isLoading: Bool)
case setErrorState(_ errorState: ErrorState?)
case setCartResponse(_ cart: Cart?)
case setCartIsEmpty(_ cartIsEmpty: Bool)
case setShouldCheckCartExist(_ shouldCheck: Bool)
case setNeedsPresentAlertOnSuccessfulCartsMerge(_ needsAction: Bool)
case setCollectionSections(_ sections: [SafeCollectionSection])
case updateSpoilerBannerSection(SafeCollectionSection)
case removeSpoilerBannerSection
case setSoldOutCellsIds(_ ids: [String])
case setShouldScrollToItemAt(_ indexPath: IndexPath?)
case setShouldPerformBatchUpdates(_ shouldPerform: Bool)
case setPromocodeItem(_ item: PromoCodeFieldViewModel?)
case setPromocodeError(message: String)
case setRoutingTarget(_ target: Basket2ModuleState.ViewState.RoutingTarget?)
case setIsUserInteractionEnabled(_ isEnabled: Bool)
case setShouldShowCheckoutOverlay(_ should: Bool)
case setCheckoutOverlayViewData(_ item: CheckoutOverlayViewModelProtocol?, _ appearance: CheckoutOverlayView.Appearance?)
case setShouldLoadDataOnAppear(_ shouldLoad: Bool)
case setAnalyticsEvent(_ event: Basket2AnalyticsEvent?)
case setSpoilerBanner(banner: Banner?)
case setIsSpoilerBannerHidden(Bool)
case setIsSpoilerBannerExpanded(Bool)
}
Хренасе состояний
Обсуждают сегодня