{"id":51306982,"url":"https://github.com/icerockdev/moko-state","last_synced_at":"2026-07-01T00:32:49.162Z","repository":{"id":356700820,"uuid":"1162686223","full_name":"icerockdev/moko-state","owner":"icerockdev","description":null,"archived":false,"fork":false,"pushed_at":"2026-05-09T10:46:42.000Z","size":98,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-09T11:13:44.495Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/icerockdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-20T15:13:41.000Z","updated_at":"2026-05-09T10:46:46.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/icerockdev/moko-state","commit_stats":null,"previous_names":["icerockdev/moko-state"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/icerockdev/moko-state","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icerockdev%2Fmoko-state","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icerockdev%2Fmoko-state/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icerockdev%2Fmoko-state/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icerockdev%2Fmoko-state/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/icerockdev","download_url":"https://codeload.github.com/icerockdev/moko-state/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icerockdev%2Fmoko-state/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34988712,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-30T02:00:05.919Z","response_time":92,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2026-07-01T00:32:48.444Z","updated_at":"2026-07-01T00:32:49.132Z","avatar_url":"https://github.com/icerockdev.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mobile Kotlin RemoteState\n\nA Kotlin Multiplatform library for managing remote state in your Android, iOS, and Web applications.\n\n## Overview\n\nMoko State provides a simple and efficient way to handle remote data states with Kotlin's coroutines and Flow.\nIt's designed for multiplatform projects, allowing you to share state management logic across iOS, Android, and Web platforms.\n\n## Features\n\n- **Multiplatform support**: Works on Android, iOS, and Web\n- **Coroutines \u0026 Flow**: Built on Kotlin coroutines and Flow for reactive programming\n- **Simple API**: Easy to use with intuitive state representation\n- **Type-safe**: Compile-time safe state transitions\n- **Zero dependencies**: Pure Kotlin implementation\n\n## Getting Started\n\n### Gradle Setup\n\nAdd the dependency to your common source set:\n\n```kotlin\nimplementation(\"dev.icerock.moko:state:[latestVersion]\")\n```\n\n### Usage\n\n```kotlin\nimport dev.icerock.moko.state.RemoteState\nimport dev.icerock.moko.state.mapSuccess\n\n// Define your state\nval stateFlow = MutableStateFlow\u003cRemoteState\u003cString, Exception\u003e\u003e(\n    value = RemoteState.Loading\n)\n\n// Update state\nstateFlow.value = RemoteState.Success(\"Hello, World!\")\n\n// Map success value\nval mappedState = stateFlow.value.mapSuccess { it.uppercase() }\n\n// Check state\nif (mappedState.isSuccess()) {\n    println(mappedState.data)\n}\n```\n\n## API Reference\n\n### RemoteState\n\nA sealed class representing the state of remote data.\n\n- `Loading` - Represents an ongoing operation\n- `Success\u003cT\u003e` - Contains successfully loaded data\n- `Error\u003cE\u003e` - Contains an error occurred during operation\n\n### Functions\n\n- `mapSuccess` - Transform data in Success state\n- `mapError` - Transform error in Error state\n- `isLoading` - Check if state is loading\n- `isSuccess` - Check if state is successful\n- `tryUpdateSuccess` - Atomically update data in Success state\n\n## Contributing\nAll development (both new features and bug fixes) is performed in the `develop` branch. This way `master` always contains the sources of the most recently released version. Please send PRs with bug fixes to the `develop` branch. Documentation fixes in the markdown files are an exception to this rule. They are updated directly in `master`.\n\nThe `develop` branch is pushed to `master` on release.\n\nFor more details on contributing please see the [contributing guide](CONTRIBUTING.md).\n\n## License\n\nApache 2.0 License - see [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficerockdev%2Fmoko-state","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ficerockdev%2Fmoko-state","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficerockdev%2Fmoko-state/lists"}