Closed brady-aiello closed 2 years ago
The code in NativeViewModel and MainViewModel (Android) is nearly identical.
We can make them both implement an interface with mostly default functions, and keep platform-specific code minimal. Platform-specific stuff:
CoroutineScope
Flow
./gradlew :app:build
./gradlew :shared:build
xcodebuild -workspace ios/KaMPKitiOS.xcworkspace -scheme KaMPKitiOS -sdk iphoneos -configuration Debug build -destination name="iPhone 8"
PR https://github.com/touchlab/KaMPKit/pull/238 is a merge of the view model concept PRs. Closing this one.
Summary
The code in NativeViewModel and MainViewModel (Android) is nearly identical.
Fix
We can make them both implement an interface with mostly default functions, and keep platform-specific code minimal. Platform-specific stuff:
CoroutineScope
for eachFlow
s through callbacks for iOSTesting
./gradlew :app:build
./gradlew :shared:build
xcodebuild -workspace ios/KaMPKitiOS.xcworkspace -scheme KaMPKitiOS -sdk iphoneos -configuration Debug build -destination name="iPhone 8"