{"id":45030344,"url":"https://github.com/vaukalak/react-mlyn","last_synced_at":"2026-02-19T05:04:53.281Z","repository":{"id":45212625,"uuid":"398062216","full_name":"vaukalak/react-mlyn","owner":"vaukalak","description":"react bindings to mlyn","archived":false,"fork":false,"pushed_at":"2022-01-24T10:51:08.000Z","size":305,"stargazers_count":23,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-09T14:35:38.794Z","etag":null,"topics":["immutability","mlyn","react","react-hooks","reactjs","state-management","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vaukalak.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}},"created_at":"2021-08-19T20:07:26.000Z","updated_at":"2025-07-09T18:10:34.000Z","dependencies_parsed_at":"2022-08-28T16:40:53.466Z","dependency_job_id":null,"html_url":"https://github.com/vaukalak/react-mlyn","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/vaukalak/react-mlyn","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaukalak%2Freact-mlyn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaukalak%2Freact-mlyn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaukalak%2Freact-mlyn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaukalak%2Freact-mlyn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vaukalak","download_url":"https://codeload.github.com/vaukalak/react-mlyn/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaukalak%2Freact-mlyn/sbom","scorecard":{"id":916980,"data":{"date":"2025-08-11","repo":{"name":"github.com/vaukalak/react-mlyn","commit":"2cb8127a0adbcf606179ec058897cd0a5248b811"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/21 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 10 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"17 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-jgrx-mgxx-jf9v","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-24T21:23:59.205Z","repository_id":45212625,"created_at":"2025-08-24T21:23:59.205Z","updated_at":"2025-08-24T21:23:59.205Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29604193,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T04:38:07.383Z","status":"ssl_error","status_checked_at":"2026-02-19T04:35:50.016Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["immutability","mlyn","react","react-hooks","reactjs","state-management","typescript"],"created_at":"2026-02-19T05:04:52.746Z","updated_at":"2026-02-19T05:04:53.274Z","avatar_url":"https://github.com/vaukalak.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-mlyn\nReact bindings to [mlyn](https://github.com/vaukalak/mlyn)\n\n## Goals of this library:\n- Reduce re-renders of the application due to subscription based model (update only components that changed).\n- Allow 2 way binding, without violating Unidirectional Data Flow.\n- Reduce react app / components boilerplate.\n- Reduce the amount of properties passed to components props / context, and make components reuse easier.\n\n## Installation\n\nInstall both `react-mlyn` and `mlyn`.\n```\nyarn add react-mlyn mlyn\n```\nor\n```\nnpm i -S react-mlyn mlyn\n```\n\n## Eamples\n\n- [Simple TodoMVC app](https://codesandbox.io/s/react-mlyn-todo-mvc-owecw)\n- [Advanced TodoMVC app](https://codesandbox.io/s/react-mlyn-todo-mvc-with-filters-i5e7j)\n- [Currency conversion calculator](https://codesandbox.io/s/mlyn-currency-converter-t5w0o)\n- [tic-tac game](https://codesandbox.io/s/mlyn-tic-tac-game-27c6r)\n\n## Quick start\n\n```tsx\nimport Mlyn, { useSubject, seal } from \"react-mlyn\";\n\nconst App = seal(() =\u003e {\n  const firstName$ = useSubject(\"Barbara\");\n  const lastName$ = useSubject(\"Radzivil\");\n  return (\n    \u003cdiv\u003e\n      \u003cdiv\u003eFirst name:\u003c/div\u003e\n      \u003cMlyn.Input bindValue={firstName$} /\u003e\n      \u003cdiv\u003eLast name:\u003c/div\u003e\n      \u003cMlyn.Input bindValue={lastName$} /\u003e\n      \u003cdiv\u003eFull name:\u003c/div\u003e\n      \u003cMlyn.Div\u003e{() =\u003e `${firstName$()} ${lastName$()}`}\u003c/Mlyn.Div\u003e\n    \u003c/div\u003e\n  );\n});\n```\n\n## Documentation\n\n### Components\n\n**Show**\n\nCan show / hide an element on a condition, without re-rendering host component:\n```tsx\n\u003cShow when={() =\u003e subject() \u003e 1}\u003e\n  {() =\u003e (\n      \u003cdiv\u003eMore than 1\u003c/div\u003e\n  )}\n\u003c/Show\u003e\n```\n\n**For**\n\nUsed to display a collection of elements, by providing items to render and key extractor.\n```tsx\n\u003cFor each={state$.todos}\u003e\n  {(todo$, index$) =\u003e (\n    \u003cdiv\u003e\n      \u003cMlyn.Input type=\"checkbox\" bindChecked={todo$.done} /\u003e\n      \u003cMlyn.Input bindValue={todo$.title} /\u003e\n      \u003cbutton onClick={() =\u003e removeItem(index$())}\u003ex\u003c/button\u003e\n    \u003c/div\u003e\n  )}\n\u003c/For\u003e\n```\n\n\n\n### Hooks\n\n**useSubject**:\nCreates a memoized subject, by passing to it initial state:\n\n```ts\nconst subject = useSubject({ x: 1 });\n```\n\n**useMlynEffect**:\nSimlar to reacts `useEffect`,  however doesn't require dependencies, cause it's automatically subscribed to to mlyn bindings. Please note, that invocation of hook callback doesn't mean that component has been re-rendered.\n\n```ts\nconst usePersist = (key: string, subject: Sybject\u003cany\u003e) =\u003e {\n    useEffect(() =\u003e {\n        const persisted = localStorage.getItem(key);\n        if (persisted) {\n            subject(JSON.parse(persisted));\n        }\n    }, []); // will perform once\n    useMlynEffect(() =\u003e {\n        localStorage.setItem(key, JSON.stringify(subject());\n    });\n}\n```\n\n**(Advanced) useSubjectValue**: creates react state entry binded to the subject value. This hook will cause component re-render, which might can be required in components like `For`.\n```ts\nconst subject = useSubject(0);\nconst value = useSubjectValue(subject); // starts with 0\nuseEffect(() =\u003e {\n    subject(1);\n    // component will rerender\n    // `value` will become 1\n}, []);\n\n```\n\nSince `subject` has been invoked during execution of `useMlynEffect` callback, this callback will be reinvoked on every change of `subject` value.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvaukalak%2Freact-mlyn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvaukalak%2Freact-mlyn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvaukalak%2Freact-mlyn/lists"}