-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from ReSwift/feature/2.0
Feature/2.0
- Loading branch information
Showing
22 changed files
with
2,445 additions
and
333 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import Combine | ||
|
||
extension Optional { | ||
func publisher() -> AnyPublisher<Wrapped, Never> { | ||
switch self { | ||
case let .some(wrapped): | ||
return Just(wrapped).eraseToAnyPublisher() | ||
case .none: | ||
return Empty().eraseToAnyPublisher() | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
public struct ActionLens<RawAction, BaseRefinedAction, SubRefinedAction> { | ||
let dispatchFunction: (ActionStrata<[RawAction], [SubRefinedAction]>) -> Void | ||
|
||
public func callAsFunction<S: Sequence>(actions: S) where S.Element == SubRefinedAction { | ||
dispatchFunction(.refined(.init(actions))) | ||
} | ||
|
||
public func callAsFunction<S: Sequence>(actions: S) where S.Element == RawAction { | ||
dispatchFunction(.raw(.init(actions))) | ||
} | ||
} | ||
|
||
public extension ActionLens { | ||
func callAsFunction(actions: SubRefinedAction...) { | ||
dispatchFunction(.refined(actions)) | ||
} | ||
|
||
func callAsFunction(actions: RawAction...) { | ||
dispatchFunction(.raw(actions)) | ||
} | ||
} |
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
Oops, something went wrong.