Recent Releases of cycle
cycle - Release 0.11.1 (24)
This is a hotfix release from version 0.11.0 (23). Refer to the 0.11.0 (23) release for more information about this release.
Fixes
- Fixed iOS build
Full Changelog: https://github.com/chRyNaN/cycle/compare/0.11.0...0.11.1
- Kotlin
Published by chRyNaN about 3 years ago
cycle - Release 0.11.0 (23)
Note: This release contains significant breaking changes from previous versions.
- Updated Kotlin to version
1.8.20 - Updated Compose Multiplatform to version
1.4.0 - Updated other dependencies
- Renamed project from
presentationtocycle - Foundational changes in components and structure
- Simplification of API
New API is compatible with Redux, MVI, and MVVM:
```kotlin fun counterReducer(state: Int?, change: CounterChange): Int { val value = state ?: 0
return when (change) {
CounterChange.INCREMENT -> value + 1
CounterChange.DECREMENT -> value - 1
}
}
@Composable
fun Counter(viewModel: ViewModel
Text("Count = $state")
LaunchedEffect(Unit) {
viewModel.dispatch(CounterChange.INCREMENT) // 1
viewModel.dispatch(CounterChange.INCREMENT) // 2
viewModel.dispatch(CounterChange.DECREMENT) // 1
}
} ```
Full Changelog: https://github.com/chRyNaN/cycle/compare/0.10.0...0.11.0
- Kotlin
Published by chRyNaN about 3 years ago
cycle - Release 0.10.0 (22)
- Created
MutableStateStoreinterface - Created
ViewModelFlowScopeinterface - Added
resetOnUnbindproperty toViewModelclass - Updated Kotlin to version
1.7.20 - Updated compose-jb to version
1.3.0-beta03 - Updated other dependencies
- Created
ViewModelProviderand updatedViewModelFactoryand changed its focus - Created
ComposeLayoutfunction - Created
LocalViewModelProviderprovidable composition local for Jetpack Compose - Created
rememberViewModelfunction for Jetpack Compose
Full Changelog: https://github.com/chRyNaN/presentation/compare/0.9.0...0.10.0
- Kotlin
Published by chRyNaN over 3 years ago
cycle - Release 0.9.0 (21)
- Updated Kotlin to version 1.7.10 and compose-jb to version 1.2.0-beta01
- Added iOS and JS support to the
presentation-composemodule - Made
renderStateandisBoundpropertiesfinalin theLayoutclass - Renamed
BaseViewModeltoPlatformViewModel
Full Changelog: https://github.com/chRyNaN/presentation/compare/0.8.0...0.9.0###
- Kotlin
Published by chRyNaN over 3 years ago
cycle - Release 0.8.0 (20)
- Updated Kotlin to version
1.7.0 - Updated compose-jb to version
1.2.0-alpha01-dev755
Full Changelog: https://github.com/chRyNaN/presentation/compare/0.7.4...0.8.0
- Kotlin
Published by chRyNaN almost 4 years ago
cycle - Release 0.7.4 (19)
- Renamed
ViewModeltoBaseViewModeland made its constructorinternal - Renamed
BasePresentertoViewModel - Renamed
PresenterFactorytoViewModelFactory - Library now uses more of a "ViewModel" approach to the communication channel between the
Viewand the other design pattern components, instead of the previous "Presenter" approach. This removes a cyclic dependence between theViewand the Presenter/ViewModel component.- Previously, the
BasePresenterhad a reference to theView, and theViewhad a reference to thePresenter. This was needed so that thePresentercould call theView.renderfunction with the new derived State, and so theViewcould emit intents to the Presenter. This was later abstracted, by having theBasePresenteronly take aFlow<Intent>instead of aView, so that there would be no direct reference to the View. These approaches required aPresenterFactoryto simplify the creation of a Presenter, and inject the View it was bound to. - Now, only the
Viewhas a reference to theViewModel(previously BasePresenter). TheViewemits intents by calling theViewModel.intentfunction. And theViewsubscribes to State changes via theViewModel.renderStatesproperty. This way there is no cyclic dependency requirement between the two components.
- Previously, the
- Created
View.intentextension function for convenience that just delegates to theViewModel.intentfunction.
New usage of the library would look like the following:
```kotlin
class HomeLayout : Layout
override val viewModel = ViewModel<I, S, C>(
perform = { intent, state -> ... },
reduce = { state, change -> ... })
@Composable
override fun Content() {
val state by stateChanges()
Text("State = $state")
}
override fun onBind() {
intent(to HomeIntent.Load())
}
} ```
Full Changelog: https://github.com/chRyNaN/presentation/compare/0.7.3...0.7.4
- Kotlin
Published by chRyNaN about 4 years ago
cycle - Release 0.7.3 (18)
- Updated
Layout.Contentfunction to not take a state parameter and addedstateChanges()function.- This provides more control over the states to be rendered
- New usage would look like the following:
```kotlin @Composable override fun Content() { val state by stateChanges()
Text("state = $state")
} ```
Full Changelog: https://github.com/chRyNaN/presentation/compare/0.7.2...0.7.3
- Kotlin
Published by chRyNaN about 4 years ago
cycle - Release 0.7.2 (17)
- Updated dependencies
- Added support for iOS Simulator Arm64 targets
- Created
FlatMapStrategyand addedstrategyparameter toperformandperformWithfunctions in `BasePresenter - Created
IntentEventmodel - Removed
statesproperty fromViewinterface - Removed
BasePresentationActivity - Updated
BasePresentationFragment - Renamed
BasePresentationFragmenttoPresentationFragment - Created
ComposeFragment - Removed
BasePresenterFactory
Full Changelog: https://github.com/chRyNaN/presentation/compare/0.7.1...0.7.2
- Kotlin
Published by chRyNaN about 4 years ago
cycle - Release 0.7.1 (16)
- Fixed presenter retention issue with
presenterFactorydelegate functions
- Kotlin
Published by chRyNaN over 4 years ago
cycle - Release 0.7.0 (15)
- Removed the direct tight-coupling between a
Viewand aPresenter. Now, aPresenteronly has anintentsproperty instead of aviewproperty. Even though the intents typically come from aView, this is not mandatory. This allows for better decoupling and flexibility for the components. - Renamed the
Layout.OnLayoutcomposable function toLayout.Content. This follows a more similar approach to function naming with Jetpack Compose and the Android community Jetpack Compose libraries. - Renamed the
composeLayoutfunction toComposeLayoutso that it follows the capitalization approach of Compose functions. - Removed overloaded
composeLayoutfunctions, to avoid confusion between thelayoutand newComposeLayoutfunctions responsibilities. - Replaced the
Layout.presenterFactoryproperty withLayout.presenterand createdpresenterFactorydelegate functions. This is a more flexible approach as it allows direct instantiation of a Presenter or delegation to injection or aPresenterFactory. - Created more convenience
Presenterconstructor functions to reduce the boilerplate code needed to create aPresenterfor simple use-cases. - Upgraded Kotlin to version
1.6.10. - Upgraded the
compose-gradle-pluginto1.0.1. - Upgraded other dependencies.
- Kotlin
Published by chRyNaN over 4 years ago