Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
Provide synchronous get state function in side-effect.
Simplify, onEnter, onExit extension functions.
  • Loading branch information
Abhi Muktheeswarar committed Aug 2, 2021
1 parent 2e732e8 commit 61291d9
Show file tree
Hide file tree
Showing 18 changed files with 48 additions and 27 deletions.
2 changes: 1 addition & 1 deletion Flywheel.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = 'Flywheel'
spec.version = '1.1.0-RC'
spec.version = '1.1.1-RC'
spec.homepage = 'https://github.com/abhimuktheeswarar/Flywheel'
spec.source = { :git => "https://github.com/abhimuktheeswarar/Flywheel.git", :tag => "v#{spec.version}" }
spec.authors = 'Abhi Muktheeswarar'
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ kotlin {
sourceSets {
val commonMain by getting {
dependencies {
implementation("com.msabhi:flywheel:1.1.0-RC")
implementation("com.msabhi:flywheel:1.1.1-RC")
}
}
}
Expand All @@ -41,7 +41,7 @@ kotlin {
```Kotlin
dependencies {

implementation("com.msabhi:flywheel:1.1.0-RC")
implementation("com.msabhi:flywheel:1.1.1-RC")
}
```

Expand All @@ -56,7 +56,7 @@ use_frameworks!
target 'MyApp' do
pod 'Flywheel', '~> 1.1.0-RC'
pod 'Flywheel', '~> 1.1.1-RC'
end
```
Expand All @@ -70,7 +70,7 @@ import PackageDescription
let package = Package(
name: "YOUR_PROJECT_NAME",
dependencies: [
.package(url: "https://github.com/abhimuktheeswarar/Flywheel.git", from: "1.1.0-RC"),
.package(url: "https://github.com/abhimuktheeswarar/Flywheel.git", from: "1.1.1-RC"),
]
)
```
Expand Down
42 changes: 21 additions & 21 deletions flywheel/xcframework/Flywheel.xcframework/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -6,93 +6,93 @@
<array>
<dict>
<key>LibraryIdentifier</key>
<string>macos-x86_64</string>
<string>ios-x86_64-simulator</string>
<key>LibraryPath</key>
<string>flywheel.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>macos</string>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>watchos-x86_64-simulator</string>
<string>tvos-x86_64-simulator</string>
<key>LibraryPath</key>
<string>flywheel.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>watchos</string>
<string>tvos</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64</string>
<string>watchos-x86_64-simulator</string>
<key>LibraryPath</key>
<string>flywheel.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<string>watchos</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>watchos-arm64_32</string>
<string>tvos-arm64</string>
<key>LibraryPath</key>
<string>flywheel.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64_32</string>
<string>arm64</string>
</array>
<key>SupportedPlatform</key>
<string>watchos</string>
<string>tvos</string>
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>ios-x86_64-simulator</string>
<string>ios-arm64</string>
<key>LibraryPath</key>
<string>flywheel.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>x86_64</string>
<string>arm64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>tvos-arm64</string>
<string>watchos-arm64_32</string>
<key>LibraryPath</key>
<string>flywheel.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>arm64_32</string>
</array>
<key>SupportedPlatform</key>
<string>tvos</string>
<string>watchos</string>
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>tvos-x86_64-simulator</string>
<string>macos-x86_64</string>
<key>LibraryPath</key>
<string>flywheel.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>tvos</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
<string>macos</string>
</dict>
</array>
<key>CFBundlePackageType</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,7 @@ __attribute__((swift_name("SideEffect")))
*/
- (void)awaitStateWithCompletionHandler:(void (^)(S _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("awaitState(completionHandler:)")));
- (void)dispatchAction:(id<FlywheelAction>)action __attribute__((swift_name("dispatch(action:)")));
- (S)state_ __attribute__((swift_name("state()")));
@property (readonly) id<FlywheelKotlinx_coroutines_coreFlow> actionStates __attribute__((swift_name("actionStates")));
@property (readonly) id<FlywheelKotlinx_coroutines_coreFlow> actions __attribute__((swift_name("actions")));
@property (readonly) id<FlywheelDispatcherProvider> dispatchers __attribute__((swift_name("dispatchers")));
Expand Down Expand Up @@ -471,8 +472,10 @@ __attribute__((swift_name("FlywheelKt")))
+ (void)reduceError __attribute__((swift_name("reduceError()")));
+ (id<FlywheelState> (^)(id<FlywheelAction>, id<FlywheelState>))reducerForActionReducer:(id<FlywheelState> (^)(id<FlywheelAction>, id<FlywheelState>))reducer __attribute__((swift_name("reducerForAction(reducer:)")));
+ (id<FlywheelKotlinx_coroutines_coreFlow>)inValidTransition:(id<FlywheelKotlinx_coroutines_coreFlow>)receiver __attribute__((swift_name("inValidTransition(_:)")));
+ (id<FlywheelKotlinx_coroutines_coreFlow>)inValidTransitionWithAction:(id<FlywheelKotlinx_coroutines_coreFlow>)receiver __attribute__((swift_name("inValidTransitionWithAction(_:)")));
+ (id<FlywheelKotlinx_coroutines_coreFlow>)onEnter:(id<FlywheelKotlinx_coroutines_coreFlow>)receiver __attribute__((swift_name("onEnter(_:)")));
+ (id<FlywheelKotlinx_coroutines_coreFlow>)onExit:(id<FlywheelKotlinx_coroutines_coreFlow>)receiver __attribute__((swift_name("onExit(_:)")));
+ (id<FlywheelKotlinx_coroutines_coreFlow>)onlyActions:(id<FlywheelKotlinx_coroutines_coreFlow>)receiver __attribute__((swift_name("onlyActions(_:)")));
+ (id _Nullable (^)(id<FlywheelAction>, id _Nullable))plus:(id _Nullable (^)(id<FlywheelAction>, id _Nullable))receiver other:(id _Nullable (^)(id<FlywheelAction>, id _Nullable))other __attribute__((swift_name("plus(_:other:)")));
+ (id<FlywheelKotlinx_coroutines_coreFlow>)specificActions:(id<FlywheelKotlinx_coroutines_coreFlow>)receiver __attribute__((swift_name("specificActions(_:)")));
+ (id<FlywheelKotlinx_coroutines_coreFlow>)specificStates:(id<FlywheelKotlinx_coroutines_coreFlow>)receiver transform:(id<FlywheelKotlinSuspendFunction1>)transform __attribute__((swift_name("specificStates(_:transform:)")));
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,7 @@ __attribute__((swift_name("SideEffect")))
*/
- (void)awaitStateWithCompletionHandler:(void (^)(S _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("awaitState(completionHandler:)")));
- (void)dispatchAction:(id<FlywheelAction>)action __attribute__((swift_name("dispatch(action:)")));
- (S)state_ __attribute__((swift_name("state()")));
@property (readonly) id<FlywheelKotlinx_coroutines_coreFlow> actionStates __attribute__((swift_name("actionStates")));
@property (readonly) id<FlywheelKotlinx_coroutines_coreFlow> actions __attribute__((swift_name("actions")));
@property (readonly) id<FlywheelDispatcherProvider> dispatchers __attribute__((swift_name("dispatchers")));
Expand Down Expand Up @@ -471,8 +472,10 @@ __attribute__((swift_name("FlywheelKt")))
+ (void)reduceError __attribute__((swift_name("reduceError()")));
+ (id<FlywheelState> (^)(id<FlywheelAction>, id<FlywheelState>))reducerForActionReducer:(id<FlywheelState> (^)(id<FlywheelAction>, id<FlywheelState>))reducer __attribute__((swift_name("reducerForAction(reducer:)")));
+ (id<FlywheelKotlinx_coroutines_coreFlow>)inValidTransition:(id<FlywheelKotlinx_coroutines_coreFlow>)receiver __attribute__((swift_name("inValidTransition(_:)")));
+ (id<FlywheelKotlinx_coroutines_coreFlow>)inValidTransitionWithAction:(id<FlywheelKotlinx_coroutines_coreFlow>)receiver __attribute__((swift_name("inValidTransitionWithAction(_:)")));
+ (id<FlywheelKotlinx_coroutines_coreFlow>)onEnter:(id<FlywheelKotlinx_coroutines_coreFlow>)receiver __attribute__((swift_name("onEnter(_:)")));
+ (id<FlywheelKotlinx_coroutines_coreFlow>)onExit:(id<FlywheelKotlinx_coroutines_coreFlow>)receiver __attribute__((swift_name("onExit(_:)")));
+ (id<FlywheelKotlinx_coroutines_coreFlow>)onlyActions:(id<FlywheelKotlinx_coroutines_coreFlow>)receiver __attribute__((swift_name("onlyActions(_:)")));
+ (id _Nullable (^)(id<FlywheelAction>, id _Nullable))plus:(id _Nullable (^)(id<FlywheelAction>, id _Nullable))receiver other:(id _Nullable (^)(id<FlywheelAction>, id _Nullable))other __attribute__((swift_name("plus(_:other:)")));
+ (id<FlywheelKotlinx_coroutines_coreFlow>)specificActions:(id<FlywheelKotlinx_coroutines_coreFlow>)receiver __attribute__((swift_name("specificActions(_:)")));
+ (id<FlywheelKotlinx_coroutines_coreFlow>)specificStates:(id<FlywheelKotlinx_coroutines_coreFlow>)receiver transform:(id<FlywheelKotlinSuspendFunction1>)transform __attribute__((swift_name("specificStates(_:transform:)")));
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,7 @@ __attribute__((swift_name("SideEffect")))
*/
- (void)awaitStateWithCompletionHandler:(void (^)(S _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("awaitState(completionHandler:)")));
- (void)dispatchAction:(id<FlywheelAction>)action __attribute__((swift_name("dispatch(action:)")));
- (S)state_ __attribute__((swift_name("state()")));
@property (readonly) id<FlywheelKotlinx_coroutines_coreFlow> actionStates __attribute__((swift_name("actionStates")));
@property (readonly) id<FlywheelKotlinx_coroutines_coreFlow> actions __attribute__((swift_name("actions")));
@property (readonly) id<FlywheelDispatcherProvider> dispatchers __attribute__((swift_name("dispatchers")));
Expand Down Expand Up @@ -471,8 +472,10 @@ __attribute__((swift_name("FlywheelKt")))
+ (void)reduceError __attribute__((swift_name("reduceError()")));
+ (id<FlywheelState> (^)(id<FlywheelAction>, id<FlywheelState>))reducerForActionReducer:(id<FlywheelState> (^)(id<FlywheelAction>, id<FlywheelState>))reducer __attribute__((swift_name("reducerForAction(reducer:)")));
+ (id<FlywheelKotlinx_coroutines_coreFlow>)inValidTransition:(id<FlywheelKotlinx_coroutines_coreFlow>)receiver __attribute__((swift_name("inValidTransition(_:)")));
+ (id<FlywheelKotlinx_coroutines_coreFlow>)inValidTransitionWithAction:(id<FlywheelKotlinx_coroutines_coreFlow>)receiver __attribute__((swift_name("inValidTransitionWithAction(_:)")));
+ (id<FlywheelKotlinx_coroutines_coreFlow>)onEnter:(id<FlywheelKotlinx_coroutines_coreFlow>)receiver __attribute__((swift_name("onEnter(_:)")));
+ (id<FlywheelKotlinx_coroutines_coreFlow>)onExit:(id<FlywheelKotlinx_coroutines_coreFlow>)receiver __attribute__((swift_name("onExit(_:)")));
+ (id<FlywheelKotlinx_coroutines_coreFlow>)onlyActions:(id<FlywheelKotlinx_coroutines_coreFlow>)receiver __attribute__((swift_name("onlyActions(_:)")));
+ (id _Nullable (^)(id<FlywheelAction>, id _Nullable))plus:(id _Nullable (^)(id<FlywheelAction>, id _Nullable))receiver other:(id _Nullable (^)(id<FlywheelAction>, id _Nullable))other __attribute__((swift_name("plus(_:other:)")));
+ (id<FlywheelKotlinx_coroutines_coreFlow>)specificActions:(id<FlywheelKotlinx_coroutines_coreFlow>)receiver __attribute__((swift_name("specificActions(_:)")));
+ (id<FlywheelKotlinx_coroutines_coreFlow>)specificStates:(id<FlywheelKotlinx_coroutines_coreFlow>)receiver transform:(id<FlywheelKotlinSuspendFunction1>)transform __attribute__((swift_name("specificStates(_:transform:)")));
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,7 @@ __attribute__((swift_name("SideEffect")))
*/
- (void)awaitStateWithCompletionHandler:(void (^)(S _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("awaitState(completionHandler:)")));
- (void)dispatchAction:(id<FlywheelAction>)action __attribute__((swift_name("dispatch(action:)")));
- (S)state_ __attribute__((swift_name("state()")));
@property (readonly) id<FlywheelKotlinx_coroutines_coreFlow> actionStates __attribute__((swift_name("actionStates")));
@property (readonly) id<FlywheelKotlinx_coroutines_coreFlow> actions __attribute__((swift_name("actions")));
@property (readonly) id<FlywheelDispatcherProvider> dispatchers __attribute__((swift_name("dispatchers")));
Expand Down Expand Up @@ -471,8 +472,10 @@ __attribute__((swift_name("FlywheelKt")))
+ (void)reduceError __attribute__((swift_name("reduceError()")));
+ (id<FlywheelState> (^)(id<FlywheelAction>, id<FlywheelState>))reducerForActionReducer:(id<FlywheelState> (^)(id<FlywheelAction>, id<FlywheelState>))reducer __attribute__((swift_name("reducerForAction(reducer:)")));
+ (id<FlywheelKotlinx_coroutines_coreFlow>)inValidTransition:(id<FlywheelKotlinx_coroutines_coreFlow>)receiver __attribute__((swift_name("inValidTransition(_:)")));
+ (id<FlywheelKotlinx_coroutines_coreFlow>)inValidTransitionWithAction:(id<FlywheelKotlinx_coroutines_coreFlow>)receiver __attribute__((swift_name("inValidTransitionWithAction(_:)")));
+ (id<FlywheelKotlinx_coroutines_coreFlow>)onEnter:(id<FlywheelKotlinx_coroutines_coreFlow>)receiver __attribute__((swift_name("onEnter(_:)")));
+ (id<FlywheelKotlinx_coroutines_coreFlow>)onExit:(id<FlywheelKotlinx_coroutines_coreFlow>)receiver __attribute__((swift_name("onExit(_:)")));
+ (id<FlywheelKotlinx_coroutines_coreFlow>)onlyActions:(id<FlywheelKotlinx_coroutines_coreFlow>)receiver __attribute__((swift_name("onlyActions(_:)")));
+ (id _Nullable (^)(id<FlywheelAction>, id _Nullable))plus:(id _Nullable (^)(id<FlywheelAction>, id _Nullable))receiver other:(id _Nullable (^)(id<FlywheelAction>, id _Nullable))other __attribute__((swift_name("plus(_:other:)")));
+ (id<FlywheelKotlinx_coroutines_coreFlow>)specificActions:(id<FlywheelKotlinx_coroutines_coreFlow>)receiver __attribute__((swift_name("specificActions(_:)")));
+ (id<FlywheelKotlinx_coroutines_coreFlow>)specificStates:(id<FlywheelKotlinx_coroutines_coreFlow>)receiver transform:(id<FlywheelKotlinSuspendFunction1>)transform __attribute__((swift_name("specificStates(_:transform:)")));
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,7 @@ __attribute__((swift_name("SideEffect")))
*/
- (void)awaitStateWithCompletionHandler:(void (^)(S _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("awaitState(completionHandler:)")));
- (void)dispatchAction:(id<FlywheelAction>)action __attribute__((swift_name("dispatch(action:)")));
- (S)state_ __attribute__((swift_name("state()")));
@property (readonly) id<FlywheelKotlinx_coroutines_coreFlow> actionStates __attribute__((swift_name("actionStates")));
@property (readonly) id<FlywheelKotlinx_coroutines_coreFlow> actions __attribute__((swift_name("actions")));
@property (readonly) id<FlywheelDispatcherProvider> dispatchers __attribute__((swift_name("dispatchers")));
Expand Down Expand Up @@ -471,8 +472,10 @@ __attribute__((swift_name("FlywheelKt")))
+ (void)reduceError __attribute__((swift_name("reduceError()")));
+ (id<FlywheelState> (^)(id<FlywheelAction>, id<FlywheelState>))reducerForActionReducer:(id<FlywheelState> (^)(id<FlywheelAction>, id<FlywheelState>))reducer __attribute__((swift_name("reducerForAction(reducer:)")));
+ (id<FlywheelKotlinx_coroutines_coreFlow>)inValidTransition:(id<FlywheelKotlinx_coroutines_coreFlow>)receiver __attribute__((swift_name("inValidTransition(_:)")));
+ (id<FlywheelKotlinx_coroutines_coreFlow>)inValidTransitionWithAction:(id<FlywheelKotlinx_coroutines_coreFlow>)receiver __attribute__((swift_name("inValidTransitionWithAction(_:)")));
+ (id<FlywheelKotlinx_coroutines_coreFlow>)onEnter:(id<FlywheelKotlinx_coroutines_coreFlow>)receiver __attribute__((swift_name("onEnter(_:)")));
+ (id<FlywheelKotlinx_coroutines_coreFlow>)onExit:(id<FlywheelKotlinx_coroutines_coreFlow>)receiver __attribute__((swift_name("onExit(_:)")));
+ (id<FlywheelKotlinx_coroutines_coreFlow>)onlyActions:(id<FlywheelKotlinx_coroutines_coreFlow>)receiver __attribute__((swift_name("onlyActions(_:)")));
+ (id _Nullable (^)(id<FlywheelAction>, id _Nullable))plus:(id _Nullable (^)(id<FlywheelAction>, id _Nullable))receiver other:(id _Nullable (^)(id<FlywheelAction>, id _Nullable))other __attribute__((swift_name("plus(_:other:)")));
+ (id<FlywheelKotlinx_coroutines_coreFlow>)specificActions:(id<FlywheelKotlinx_coroutines_coreFlow>)receiver __attribute__((swift_name("specificActions(_:)")));
+ (id<FlywheelKotlinx_coroutines_coreFlow>)specificStates:(id<FlywheelKotlinx_coroutines_coreFlow>)receiver transform:(id<FlywheelKotlinSuspendFunction1>)transform __attribute__((swift_name("specificStates(_:transform:)")));
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,7 @@ __attribute__((swift_name("SideEffect")))
*/
- (void)awaitStateWithCompletionHandler:(void (^)(S _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("awaitState(completionHandler:)")));
- (void)dispatchAction:(id<FlywheelAction>)action __attribute__((swift_name("dispatch(action:)")));
- (S)state_ __attribute__((swift_name("state()")));
@property (readonly) id<FlywheelKotlinx_coroutines_coreFlow> actionStates __attribute__((swift_name("actionStates")));
@property (readonly) id<FlywheelKotlinx_coroutines_coreFlow> actions __attribute__((swift_name("actions")));
@property (readonly) id<FlywheelDispatcherProvider> dispatchers __attribute__((swift_name("dispatchers")));
Expand Down Expand Up @@ -471,8 +472,10 @@ __attribute__((swift_name("FlywheelKt")))
+ (void)reduceError __attribute__((swift_name("reduceError()")));
+ (id<FlywheelState> (^)(id<FlywheelAction>, id<FlywheelState>))reducerForActionReducer:(id<FlywheelState> (^)(id<FlywheelAction>, id<FlywheelState>))reducer __attribute__((swift_name("reducerForAction(reducer:)")));
+ (id<FlywheelKotlinx_coroutines_coreFlow>)inValidTransition:(id<FlywheelKotlinx_coroutines_coreFlow>)receiver __attribute__((swift_name("inValidTransition(_:)")));
+ (id<FlywheelKotlinx_coroutines_coreFlow>)inValidTransitionWithAction:(id<FlywheelKotlinx_coroutines_coreFlow>)receiver __attribute__((swift_name("inValidTransitionWithAction(_:)")));
+ (id<FlywheelKotlinx_coroutines_coreFlow>)onEnter:(id<FlywheelKotlinx_coroutines_coreFlow>)receiver __attribute__((swift_name("onEnter(_:)")));
+ (id<FlywheelKotlinx_coroutines_coreFlow>)onExit:(id<FlywheelKotlinx_coroutines_coreFlow>)receiver __attribute__((swift_name("onExit(_:)")));
+ (id<FlywheelKotlinx_coroutines_coreFlow>)onlyActions:(id<FlywheelKotlinx_coroutines_coreFlow>)receiver __attribute__((swift_name("onlyActions(_:)")));
+ (id _Nullable (^)(id<FlywheelAction>, id _Nullable))plus:(id _Nullable (^)(id<FlywheelAction>, id _Nullable))receiver other:(id _Nullable (^)(id<FlywheelAction>, id _Nullable))other __attribute__((swift_name("plus(_:other:)")));
+ (id<FlywheelKotlinx_coroutines_coreFlow>)specificActions:(id<FlywheelKotlinx_coroutines_coreFlow>)receiver __attribute__((swift_name("specificActions(_:)")));
+ (id<FlywheelKotlinx_coroutines_coreFlow>)specificStates:(id<FlywheelKotlinx_coroutines_coreFlow>)receiver transform:(id<FlywheelKotlinSuspendFunction1>)transform __attribute__((swift_name("specificStates(_:transform:)")));
Expand Down
Binary file not shown.
Loading

0 comments on commit 61291d9

Please sign in to comment.