{"id":16124254,"url":"https://github.com/jongacnik/choo-reactive","last_synced_at":"2025-03-18T12:31:37.528Z","repository":{"id":57198218,"uuid":"157269968","full_name":"jongacnik/choo-reactive","owner":"jongacnik","description":"auto-trigger app render on state change","archived":false,"fork":false,"pushed_at":"2018-11-12T20:09:01.000Z","size":1,"stargazers_count":11,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-28T09:21:02.037Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jongacnik.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-11-12T20:07:49.000Z","updated_at":"2021-10-24T12:23:08.000Z","dependencies_parsed_at":"2022-09-16T13:12:33.455Z","dependency_job_id":null,"html_url":"https://github.com/jongacnik/choo-reactive","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jongacnik%2Fchoo-reactive","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jongacnik%2Fchoo-reactive/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jongacnik%2Fchoo-reactive/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jongacnik%2Fchoo-reactive/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jongacnik","download_url":"https://codeload.github.com/jongacnik/choo-reactive/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243926063,"owners_count":20369911,"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":[],"created_at":"2024-10-09T21:20:18.468Z","updated_at":"2025-03-18T12:31:37.272Z","avatar_url":"https://github.com/jongacnik.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# choo-reactive\n\nauto-trigger app render on state change. Uses [on-change](https://github.com/sindresorhus/on-change) under the hood.\n\n## Example\n\nClone of the [choo example](https://github.com/choojs/choo#example) but app is automatically re-rendered on state update:\n\n```js\nvar choo = require('choo')\nvar html = require('choo/html')\nvar devtools = require('choo-devtools')\nvar reactive = require('choo-reactive')\n\nvar app = choo()\napp.use(devtools())\napp.use(reactive())\napp.use(countStore)\napp.route('/', mainView)\napp.mount('body')\n\nfunction mainView (state, emit) {\n  return html`\n    \u003cbody\u003e\n      \u003ch1\u003ecount is ${state.count}\u003c/h1\u003e\n      \u003cbutton onclick=${onclick}\u003eIncrement\u003c/button\u003e\n    \u003c/body\u003e\n  `\n\n  function onclick () {\n    emit('increment', 1)\n  }\n}\n\nfunction countStore (state, emitter) {\n  state.count = 0\n  emitter.on('increment', function (count) {\n    state.count += count\n  })\n}\n```\n\n## See Also\n\n- [on-change](https://github.com/sindresorhus/on-change)\n- [`Proxy` API](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjongacnik%2Fchoo-reactive","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjongacnik%2Fchoo-reactive","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjongacnik%2Fchoo-reactive/lists"}