{"id":13537329,"url":"https://github.com/gumil/kaskade","last_synced_at":"2025-04-02T04:30:31.394Z","repository":{"id":97885060,"uuid":"120153669","full_name":"gumil/Kaskade","owner":"gumil","description":"[INACTIVE] Simplifying state management","archived":false,"fork":false,"pushed_at":"2020-08-26T21:55:11.000Z","size":739,"stargazers_count":224,"open_issues_count":10,"forks_count":6,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-11-03T02:32:49.055Z","etag":null,"topics":["android","coroutines","flow","kaskade","kotlin","machine","multiplatform","mvi","state","udf","unidirectional-data-flow"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gumil.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-02-04T04:09:15.000Z","updated_at":"2024-05-18T16:42:22.000Z","dependencies_parsed_at":"2023-05-31T11:31:19.480Z","dependency_job_id":null,"html_url":"https://github.com/gumil/Kaskade","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gumil%2FKaskade","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gumil%2FKaskade/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gumil%2FKaskade/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gumil%2FKaskade/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gumil","download_url":"https://codeload.github.com/gumil/Kaskade/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246756797,"owners_count":20828768,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","coroutines","flow","kaskade","kotlin","machine","multiplatform","mvi","state","udf","unidirectional-data-flow"],"created_at":"2024-08-01T09:00:57.725Z","updated_at":"2025-04-02T04:30:31.381Z","avatar_url":"https://github.com/gumil.png","language":"Kotlin","readme":"# Kaskade\n[![Build Status](https://travis-ci.org/gumil/Kaskade.svg?branch=master)](https://travis-ci.org/gumil/Kaskade)\n[![Download](https://api.bintray.com/packages/gumil/maven/kaskade/images/download.svg)](https://bintray.com/gumil/maven/kaskade/_latestVersion)\n[![Android Arsenal]( https://img.shields.io/badge/Android%20Arsenal-Kaskade-green.svg?style=flat )]( https://android-arsenal.com/details/1/7421 )\n[![codecov](https://codecov.io/gh/gumil/Kaskade/branch/master/graph/badge.svg)](https://codecov.io/gh/gumil/Kaskade)\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/832c3f8fcb4c4213bc72d674db75138f)](https://www.codacy.com/app/gumil/Kaskade?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=gumil/Kaskade\u0026amp;utm_campaign=Badge_Grade)\n\nState Container for Kotlin and Android.\n\nThe name comes from cascade, a waterfall, which reflects the objective of the library to make flows easier with unidirectional data flow.\n\nInspired by **MVI** or **Model View Intent**.\n\n![Kaskade](art/kaskade.svg)\n\n## Why Kaskade?\n* **Lightweight** - enforces unidirectional data flow without the use of external dependencies.\n* **Modular** - can be easily substituted to different implementation with or without the use of another library.\n* **Extendable** - in relation to modular and lightweight, it's important to extend the API and create user defined implementation to fit specific requirements.\n* **Unidirectional** - data flows in one direction.\n* **Predictable** - control on `state` changes and `action` triggers.\n* **DSL** - able to hide complexity in a fluent way.\n* **Multiplatform** - built for JVM, iOS, and Javascript.\n\n## Installation\n1. Add to **`settings.gradle`**\n```\nenableFeaturePreview('GRADLE_METADATA')\n```\n2. Add the dependency\n```\ndependencies {\n  // core module\n  implementation 'dev.gumil.kaskade:core:0.x.y'\n  // coroutines module\n  implementation 'dev.gumil.kaskade:coroutines:0.x.y'\n  // rx module\n  implementation 'dev.gumil.kaskade:rx:0.x.y'\n  // livedata module\n  implementation 'dev.gumil.kaskade:livedata:0.x.y'\n}\n```\n(Please replace x and y with the latest version numbers: [![Download](https://api.bintray.com/packages/gumil/maven/kaskade/images/download.svg)](https://bintray.com/gumil/maven/kaskade/_latestVersion) )\n\n## Usage\nCreate the `Action` and `State` objects.\n\n_Note: objects are only used here for simplicity in real projects data classes are more appropriate_\n\n```Kotlin\ninternal sealed class TestState : State {\n    object State1 : TestState()\n    object State2 : TestState()\n    object State3 : TestState()\n}\n\ninternal sealed class TestAction : Action {\n    object Action1 : TestAction()\n    object Action2 : TestAction()\n    object Action3 : TestAction()\n}\n```\n\nCreate `Kaskade` with `TestState.State1` as initial state\n```Kotlin\nval kaskade = Kaskade.create\u003cTestAction, TestState\u003e(TestState.State1) {\n    on\u003cTestAction.Action1\u003e {\n        TestState.State1\n    }\n\n    on\u003cTestAction.Action2\u003e {\n        TestState.State2\n    }\n\n    on\u003cTestAction.Action3\u003e {\n        TestState.State3\n    }\n}\n```\n\nAdding actions to `Action` with parameter [ActionState](kaskade/core/src/commonMain/kotlin/dev/gumil/kaskade/models.kt)\n```Kotlin\non\u003cTestAction.Action1\u003e { actionState -\u003e\n    // do any side effects when returning a new state\n    TestState.State1\n}\n```\n\nObserving states\n```Kotlin\nkaskade.onStateChanged = {\n    // Do something with new state\n    render(it)\n}\n```\n\nObserving states with [Emitter](kaskade/core/src/commonMain/kotlin/dev/gumil/kaskade/flow/Emitter.kt)\n```Kotlin\nkaskade.stateEmitter().subscribe {\n    // Do something with new state\n    render(it)\n}\n```\n\nExecuting actions\n```Kotlin\nkaskade.dispatch(TestAction.Action1)\n```\n\n## Documentation\nCheck out the [wiki](https://github.com/gumil/Kaskade/wiki) for documentation.\n\nSome of the topics covered are:\n* **[Coroutines](https://github.com/gumil/Kaskade/wiki/Coroutines)**\n* **[RxJava](https://github.com/gumil/Kaskade/wiki/RxJava)**\n* **[LiveData](https://github.com/gumil/Kaskade/wiki/LiveData)**\n* **[Handling Process Death](https://github.com/gumil/Kaskade/wiki/Android)**\n\n### Sample projects\n* [Android App](sample/app) - Android use cases\n  * [auth](sample/app/src/main/kotlin/dev/gumil/kaskade/sample/auth) - Rx use case\n  * [network](sample/app/src/main/kotlin/dev/gumil/kaskade/sample/network) - Coroutines and LiveData use case\n  * [todo](sample/app/src/main/kotlin/dev/gumil/kaskade/sample/todo) - Vanilla kaskade use case\n\n* [Kotlin Console](sample/console) - Kotlin only project\n\n* [Giphy Android Use Case](https://github.com/gumil/giphy)\n  * Android master-detail\n  * Reactive FlowBinding and StateFlow use case\n","funding_links":[],"categories":["Libraries"],"sub_categories":["Architecture"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgumil%2Fkaskade","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgumil%2Fkaskade","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgumil%2Fkaskade/lists"}