Skip to content

Commit

Permalink
Fix: Observable에서 단일 이벤트작업에 더 적합한 Single로 변경 - Usecase
Browse files Browse the repository at this point in the history
  • Loading branch information
GeonH0 committed Jun 11, 2024
1 parent 0ab8c89 commit d4e9a9f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import RxSwift

protocol FetchFeedListUseCase {
func execute() -> Observable<Result<[Recipe], Error>>
func execute() -> Single<Result<[Recipe], Error>>
}

class DefaultFetchFeedListUseCase: FetchFeedListUseCase {
Expand All @@ -18,7 +18,7 @@ class DefaultFetchFeedListUseCase: FetchFeedListUseCase {
self.repository = repository
}

func execute() -> Observable<Result<[Recipe], Error>> {
func execute() -> Single<Result<[Recipe], Error>> {
return repository.fetchRecipes()
.map { recipes in
return .success(recipes)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import RxSwift

protocol SearchFeedListUseCase {
func execute(title: String) -> Observable<Result<[Recipe], Error>>
func execute(title: String) -> Single<Result<[Recipe], Error>>
}

class DefaultSearchFeedListUseCase: SearchFeedListUseCase {
Expand All @@ -18,7 +18,7 @@ class DefaultSearchFeedListUseCase: SearchFeedListUseCase {
self.repository = repository
}

func execute(title: String) -> Observable<Result<[Recipe], Error>> {
func execute(title: String) -> Single<Result<[Recipe], Error>> {
return repository.searchRecipes(title: title)
.map { recipes in
return .success(recipes)
Expand Down

0 comments on commit d4e9a9f

Please sign in to comment.