-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
impv(OrganizationPresent): Add organization tab reactor and bind
- Loading branch information
Showing
21 changed files
with
209 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 0 additions & 33 deletions
33
Projects/Data/CommonDataModule/CommonData/Sources/Extension/Rx+Extension.swift
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
Projects/Domain/OrganizationDomainModule/OrganizationUsecase/Sources/Sample.swift
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
...ionPresent/Sources/OrganizationTab/Compositional/Converter/OrganizationTabConverter.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// | ||
// OrganizationTabConverter.swift | ||
// OrganizationPresent | ||
// | ||
// Created by DOYEON LEE on 7/31/24. | ||
// | ||
|
||
import DesignSystem | ||
import OrganizationEntity | ||
|
||
struct OrganizationTabConverter { | ||
static func convert( | ||
entities: [OrganizationEntity], | ||
onTapNewButton: @escaping () -> Void, | ||
onTapOrganizationRow: @escaping (OrganizationEntity) -> Void | ||
) -> [any CompositionalSection] { | ||
let sections: [any CompositionalSection] = [ | ||
NewOrganizationSection( | ||
items: [ | ||
NewOrganizationItem() { | ||
onTapNewButton() | ||
} | ||
] | ||
), | ||
OrganizationSection( | ||
items: entities.map { organization in | ||
OrganizationItem( | ||
organizationName: organization.name | ||
) { | ||
onTapOrganizationRow(organization) | ||
} | ||
} | ||
) | ||
] | ||
|
||
return sections | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
...ntModule/OrganizationPresent/Sources/OrganizationTab/Reactor/OrganizationTabReactor.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
// | ||
// OrganizationTabReactor.swift | ||
// OrganizationPresent | ||
// | ||
// Created by DOYEON LEE on 7/31/24. | ||
// | ||
|
||
import OrganizationUsecase | ||
import OrganizationEntity | ||
|
||
import ReactorKit | ||
|
||
class OrganizationTabReactor: Reactor { | ||
// MARK: Action | ||
enum Action { | ||
case viewDidLoad | ||
} | ||
|
||
enum Mutation { | ||
case setOrganizations([OrganizationEntity]) | ||
} | ||
|
||
// MARK: State | ||
struct State { | ||
var organizations: [OrganizationEntity] = [] | ||
} | ||
|
||
let initialState: State = State() | ||
|
||
// MARK: ChildReactor | ||
|
||
// MARK: Dependency | ||
private let getMyOrganizationsUsecase = GetMyOrganizationsUsecase() | ||
|
||
// MARK: DisposeBag | ||
private let disposeBag = DisposeBag() | ||
|
||
// MARK: Initializer | ||
init() { } | ||
|
||
// MARK: Action operation | ||
func mutate(action: Action) -> Observable<Mutation> { | ||
switch action { | ||
case .viewDidLoad: | ||
return getMyOrganizationsUsecase.execute() | ||
.map { Mutation.setOrganizations($0) } | ||
} | ||
} | ||
|
||
func reduce(state: State, mutation: Mutation) -> State { | ||
var state = state | ||
switch mutation { | ||
case let .setOrganizations(organizations): | ||
state.organizations = organizations | ||
} | ||
return state | ||
} | ||
|
||
// MARK: Child bind | ||
private func setupChildBind() { } | ||
|
||
// MARK: Transform | ||
|
||
// MARK: Private method | ||
} |
File renamed without changes.
Oops, something went wrong.