Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Pietro Caselani
committed
Jan 10, 2020
1 parent
ed7723a
commit e042df7
Showing
6 changed files
with
118 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// Generated using Sourcery 0.17.0 — https://github.com/krzysztofzablocki/Sourcery | ||
// DO NOT EDIT | ||
|
||
// MARK: - DataStruct | ||
|
30 changes: 30 additions & 0 deletions
30
CouchTrackerCore/CodeGenerated/EnumClosures.generated.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,30 @@ | ||
// Generated using Sourcery 0.17.0 — https://github.com/krzysztofzablocki/Sourcery | ||
// DO NOT EDIT | ||
|
||
|
||
// MARK: - EnumClosures | ||
|
||
public extension MovieDetailsViewState { | ||
public func onLoading(_ fn: () -> Void) { | ||
guard case .loading = self else { return } | ||
fn() | ||
} | ||
public func onShowing(_ fn: (MovieEntity) -> Void) { | ||
guard case let .showing(movie) = self else { return } | ||
fn(movie) | ||
} | ||
public func onError(_ fn: (Error) -> Void) { | ||
guard case let .error(error) = self else { return } | ||
fn(error) | ||
} | ||
} | ||
public extension MoviesManagerViewState { | ||
public func onLoading(_ fn: () -> Void) { | ||
guard case .loading = self else { return } | ||
fn() | ||
} | ||
public func onShowing(_ fn: ([ModulePage], Int) -> Void) { | ||
guard case let .showing(pages, selectedIndex) = self else { return } | ||
fn(pages, selectedIndex) | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
CouchTrackerCore/CodeGenerated/EnumProperties.generated.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,42 @@ | ||
// Generated using Sourcery 0.17.0 — https://github.com/krzysztofzablocki/Sourcery | ||
// DO NOT EDIT | ||
|
||
|
||
// MARK: - EnumProperties | ||
|
||
public extension MovieDetailsViewState { | ||
public var isLoading: Bool { | ||
guard case .loading = self else { return false } | ||
return true | ||
} | ||
public var isShowing: Bool { | ||
guard case .showing = self else { return false } | ||
return true | ||
} | ||
public var isError: Bool { | ||
guard case .error = self else { return false } | ||
return true | ||
} | ||
public var showing: MovieEntity? { | ||
guard case let .showing(movie) = self else { return nil } | ||
return (movie) | ||
} | ||
public var error: Error? { | ||
guard case let .error(error) = self else { return nil } | ||
return (error) | ||
} | ||
} | ||
public extension MoviesManagerViewState { | ||
public var isLoading: Bool { | ||
guard case .loading = self else { return false } | ||
return true | ||
} | ||
public var isShowing: Bool { | ||
guard case .showing = self else { return false } | ||
return true | ||
} | ||
public var showing: (pages: [ModulePage], selectedIndex: Int)? { | ||
guard case let .showing(pages, selectedIndex) = self else { return nil } | ||
return (pages, selectedIndex) | ||
} | ||
} |
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,5 @@ | ||
// Generated using Sourcery 0.17.0 — https://github.com/krzysztofzablocki/Sourcery | ||
// DO NOT EDIT | ||
|
||
// MARK: - DataStruct | ||
|
16 changes: 16 additions & 0 deletions
16
CouchTrackerSync/CodeGenerated/EnumClosures.generated.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,16 @@ | ||
// Generated using Sourcery 0.17.0 — https://github.com/krzysztofzablocki/Sourcery | ||
// DO NOT EDIT | ||
|
||
|
||
// MARK: - EnumClosures | ||
|
||
public extension SyncError { | ||
public func onShowIsNil(_ fn: () -> Void) { | ||
guard case .showIsNil = self else { return } | ||
fn() | ||
} | ||
public func onMissingEpisodes(_ fn: (ShowIds, BaseSeason, Season) -> Void) { | ||
guard case let .missingEpisodes(showIds, baseSeason, season) = self else { return } | ||
fn(showIds, baseSeason, season) | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
CouchTrackerSync/CodeGenerated/EnumProperties.generated.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,20 @@ | ||
// Generated using Sourcery 0.17.0 — https://github.com/krzysztofzablocki/Sourcery | ||
// DO NOT EDIT | ||
|
||
|
||
// MARK: - EnumProperties | ||
|
||
public extension SyncError { | ||
public var isShowIsNil: Bool { | ||
guard case .showIsNil = self else { return false } | ||
return true | ||
} | ||
public var isMissingEpisodes: Bool { | ||
guard case .missingEpisodes = self else { return false } | ||
return true | ||
} | ||
public var missingEpisodes: (showIds: ShowIds, baseSeason: BaseSeason, season: Season)? { | ||
guard case let .missingEpisodes(showIds, baseSeason, season) = self else { return nil } | ||
return (showIds, baseSeason, season) | ||
} | ||
} |