{"id":16528621,"url":"https://github.com/yukukotani/kotlin-hyperapp","last_synced_at":"2026-05-27T23:32:36.142Z","repository":{"id":129042661,"uuid":"196561368","full_name":"yukukotani/kotlin-hyperapp","owner":"yukukotani","description":"Hyperapp wrapper for Kotlin/JS.","archived":false,"fork":false,"pushed_at":"2019-07-19T10:06:51.000Z","size":74,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-03T07:43:53.776Z","etag":null,"topics":["hyperapp","kotlin","kotlinjs"],"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/yukukotani.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2019-07-12T10:39:55.000Z","updated_at":"2020-10-03T17:47:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"f6d5ffc9-23fa-461d-9f6f-02635634edf1","html_url":"https://github.com/yukukotani/kotlin-hyperapp","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/yukukotani/kotlin-hyperapp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yukukotani%2Fkotlin-hyperapp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yukukotani%2Fkotlin-hyperapp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yukukotani%2Fkotlin-hyperapp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yukukotani%2Fkotlin-hyperapp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yukukotani","download_url":"https://codeload.github.com/yukukotani/kotlin-hyperapp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yukukotani%2Fkotlin-hyperapp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33588345,"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-05-27T02:00:06.184Z","response_time":53,"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":["hyperapp","kotlin","kotlinjs"],"created_at":"2024-10-11T17:41:01.838Z","updated_at":"2026-05-27T23:32:36.125Z","avatar_url":"https://github.com/yukukotani.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# kotlin-hyperapp\n\n[ ![Download](https://api.bintray.com/packages/monchi/maven/kotlin-hyperapp/images/download.svg) ](https://bintray.com/monchi/maven/kotlin-hyperapp/_latestVersion)\n\n[Hyperapp](https://github.com/jorgebucaran/hyperapp) wrapper for Kotlin/JS.\n\n## Installation\n\n```groovy\nrepositories {\n    jcenter()\n}\n\ndependencies {\n    implementation \"land.mog:kotlin-hyperapp:${version}\"\n}\n```\n\n## Usage\n\nFirst, you can define type of state and actions.\n\n```kotlin\nclass ExampleState(\n    val count: Int\n) : State\n\nclass ExampleActions(\n    val down: (Int) -\u003e (ExampleState) -\u003e ExampleState,\n    val up: (Int) -\u003e (ExampleState) -\u003e ExampleState\n) : Actions\n\n```\n\nThen, initialize default value and action.\n\n```kotlin\nval initialState = ExampleState(\n    count = 0\n)\n\nval initialActions = ExampleActions(\n    up = { value -\u003e { state -\u003e\n        ExampleState(state.count + value)\n    } },\n    down = { value -\u003e { state -\u003e\n        ExampleState(state.count - value)\n    } }\n)\n```\n\nFinally, construct view and run app.\n\n```kotlin\nval view =  { state: ExampleState, actions: ExampleActions -\u003e\n    val upAttributes = json(\n        \"onclick\" to { actions.up(1) }\n    )\n    val downAttributes = json(\n        \"onclick\" to { actions.down(1) }\n    )\n\n    h(\"div\", null, arrayOf(\n        h(\"h1\", null, arrayOf(state.count)),\n        h(\"button\", downAttributes, arrayOf(\"-\")),\n        h(\"button\", upAttributes, arrayOf(\"+\"))\n    ))\n}\n\napp(initialState, initialActions, view, document.body!!)\n```\n\nYou can also see whole example project [here](https://github.com/Monchi/kotlin-hyperapp/tree/master/example).\n\n## Build\n\nTo build, you need simply run this command:\n\n```bash\n./gradlew :kotlin-hyperapp:build\n```\n\n## License\n\nThis project is licensed under the [Apache license 2.0](https://github.com/Monchi/kotlin-hyperapp/blob/master/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyukukotani%2Fkotlin-hyperapp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyukukotani%2Fkotlin-hyperapp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyukukotani%2Fkotlin-hyperapp/lists"}