{"id":19090711,"url":"https://github.com/kodedninja/bik","last_synced_at":"2025-07-20T06:32:19.677Z","repository":{"id":143856988,"uuid":"130544048","full_name":"kodedninja/bik","owner":"kodedninja","description":"Simple functional components for non-choo \u0026 choo environments","archived":false,"fork":false,"pushed_at":"2019-04-09T21:33:48.000Z","size":77,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-04T10:07:41.653Z","etag":null,"topics":["choo","components","minimal","ui"],"latest_commit_sha":null,"homepage":"","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/kodedninja.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-22T07:11:52.000Z","updated_at":"2024-01-12T19:47:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"4fdab0ad-7718-4152-a1a9-aaa9ec50d9b0","html_url":"https://github.com/kodedninja/bik","commit_stats":{"total_commits":31,"total_committers":3,"mean_commits":"10.333333333333334","dds":0.3870967741935484,"last_synced_commit":"3d25600b00e8dc39c3bcc87dc838612d1b29d8d4"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/kodedninja/bik","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kodedninja%2Fbik","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kodedninja%2Fbik/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kodedninja%2Fbik/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kodedninja%2Fbik/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kodedninja","download_url":"https://codeload.github.com/kodedninja/bik/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kodedninja%2Fbik/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266076350,"owners_count":23872741,"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":["choo","components","minimal","ui"],"created_at":"2024-11-09T03:08:39.828Z","updated_at":"2025-07-20T06:32:19.628Z","avatar_url":"https://github.com/kodedninja.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bik\nSimple functional components for non-choo \u0026 [choo](https://github.com/choojs/choo) environments. Provides a state around [morfine](https://github.com/kodedninja/morfine).\n\n## Installation\n```\nnpm i bik\n```\n\n## Example\n```javascript\nvar component = require('bik')\nvar html = require('nanohtml')\n\nvar counter = component({ count: 0 }, function (ctx, amount) {\n  return html`\n    \u003cdiv onclick=\"${click}\"\u003eCount is ${ctx.count}\u003c/div\u003e\n  `\n\n  function click () {\n    ctx.count += amount\n    ctx.r()\n  }\n})\n\n// non-choo\ndocument.body.appendChild(counter(2))\n\n// choo\nhtml`${counter(2)}`\n```\n\nIt also works standalone in the browser by including `build/bik.min.js`. It provides a global `bik` function.\n\n## Why?\n\nTo write simple components and be able to use them outside of Choo.\n\nBik's philosophy:\n- Support both choo and non-choo environments\n- Direct access to the whole context (state + component)\n- No events, only functions\n\n## API\n### `render(...props) = bik(initialState, renderer(context, ...props))`\nInitialize a new `bik` instance. `initialState` is an `object`. The `renderer` function gets the whole context (state + component) as an argument, followed by the arguments of the `render` call.\n\n### `component.load(el)`\nCalled when the element was mounted via [`on-load`](https://github.com/shama/on-load).\n\n### `component.unload(el)`\nCalled when the element was unmounted via [`on-load`](https://github.com/shama/on-load).\n\n### `component.rerender()` or `component.r()`\nRerenders the component.\n\n### `component.beforerender(el)`\nCalled after the new tree has been generated, but not yet rendered.\n\n### `component.afterrender(el)`\nCalled after the new tree was rendered.\n\n### `component.el`\nThe current DOM Node in the document.\n\n## See Also\n- [nanocomponent](https://github.com/choojs/nanocomponent)\n- [fun-component](https://github.com/tornqvist/fun-component/)\n- [microcomponent](https://github.com/yoshuawuyts/microcomponent)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkodedninja%2Fbik","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkodedninja%2Fbik","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkodedninja%2Fbik/lists"}