-
Notifications
You must be signed in to change notification settings - Fork 200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[iOS] Add sendable conformance to event map feature #965
Changes from 3 commits
abc8a6b
2887866
5642014
4d4c176
ee41732
8effec0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ import ComposableArchitecture | |
import KMPClient | ||
import Model | ||
import Foundation | ||
@preconcurrency import shared | ||
import shared | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you remove this import with your modified? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point! |
||
|
||
@Reducer | ||
public struct EventMapReducer: Sendable { | ||
|
@@ -13,26 +13,26 @@ public struct EventMapReducer: Sendable { | |
@ObservableState | ||
public struct State: Equatable { | ||
public var selectedFloorMap: FloorMap = .first | ||
public var events: [EventMapEvent] = [] | ||
public var events: [Model.EventMapEvent] = [] | ||
public var url: IdentifiableURL? | ||
|
||
public init() { } | ||
} | ||
|
||
public enum Action: BindableAction { | ||
public enum Action: Sendable, BindableAction { | ||
case binding(BindingAction<State>) | ||
case view(View) | ||
case `internal`(Internal) | ||
|
||
@CasePathable | ||
public enum View { | ||
public enum View: Sendable { | ||
case onAppear | ||
case selectFloorMap(FloorMap) | ||
case moreDetailButtonTapped(URL) | ||
} | ||
|
||
public enum Internal { | ||
case response(Result<[EventMapEvent], any Error>) | ||
public enum Internal: Sendable { | ||
case response(Result<[Model.EventMapEvent], any Error>) | ||
} | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,24 @@ | ||||||
import Foundation | ||||||
|
||||||
public struct EventMapEvent: Equatable, Sendable, Hashable { | ||||||
public let name: MultiLangText | ||||||
public let roomName: MultiLangText | ||||||
public let roomIcon: RoomIcon | ||||||
public let description_: MultiLangText | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've renamed it. |
||||||
public let moreDetailsUrl: URL? | ||||||
public let message: MultiLangText? | ||||||
|
||||||
public init(name: MultiLangText, roomName: MultiLangText, roomIcon: RoomIcon, description_: MultiLangText, moreDetailsUrl: URL?, message: MultiLangText?) { | ||||||
self.name = name | ||||||
self.roomName = roomName | ||||||
self.roomIcon = roomIcon | ||||||
self.description_ = description_ | ||||||
self.moreDetailsUrl = moreDetailsUrl | ||||||
self.message = message | ||||||
} | ||||||
|
||||||
public func hash(into hasher: inout Hasher) { | ||||||
hasher.combine(name.enTitle) | ||||||
hasher.combine(roomName.enTitle) | ||||||
} | ||||||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import Foundation | ||
|
||
public enum RoomIcon: String, Sendable { | ||
case square | ||
case circle | ||
case diamond | ||
case rhombus | ||
case triangle | ||
case none | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove this import with your modified?
I guess Model package wrapped shared package, it makes shared imports to be no needed.