{"id":15770265,"url":"https://github.com/benbowes/vandux","last_synced_at":"2026-01-11T13:02:20.533Z","repository":{"id":38310647,"uuid":"114448127","full_name":"benbowes/vandux","owner":"benbowes","description":"Vandux - A vanillaJS Redux style pattern for use with standard html","archived":false,"fork":false,"pushed_at":"2024-12-06T11:09:56.000Z","size":2699,"stargazers_count":0,"open_issues_count":16,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-19T15:19:27.369Z","etag":null,"topics":["reducers","redux-style","state-management","typescript","vandux-store","vanilla-js"],"latest_commit_sha":null,"homepage":"https://benbowes.github.io/vandux/dist/?vandux-debug","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/benbowes.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":"2017-12-16T09:13:36.000Z","updated_at":"2024-10-22T05:21:58.000Z","dependencies_parsed_at":"2024-08-21T22:18:05.009Z","dependency_job_id":null,"html_url":"https://github.com/benbowes/vandux","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/benbowes/vandux","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benbowes%2Fvandux","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benbowes%2Fvandux/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benbowes%2Fvandux/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benbowes%2Fvandux/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benbowes","download_url":"https://codeload.github.com/benbowes/vandux/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benbowes%2Fvandux/sbom","scorecard":{"id":231539,"data":{"date":"2025-08-11","repo":{"name":"github.com/benbowes/vandux","commit":"6c59aceb4df25d3cce9c7546811ec7234afc4ed0"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.5,"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":"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":"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":"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":"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":"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":"Code-Review","score":-1,"reason":"Found no human activity in the last 15 changesets","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":"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":"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":"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":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"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 'master'"],"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 30 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":"59 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-whgm-jr23-g3j9","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-qwcr-r2fm-qrc7","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-x9w5-v3q2-3rhw","Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-434g-2637-qmqr","Warn: Project is vulnerable to: GHSA-49q7-c7j4-3p7m","Warn: Project is vulnerable to: GHSA-977x-g7h5-7qgw","Warn: Project is vulnerable to: GHSA-f7q4-pwc6-w24p","Warn: Project is vulnerable to: GHSA-fc9h-whq2-v747","Warn: Project is vulnerable to: GHSA-vjh7-7g9h-fjfh","Warn: Project is vulnerable to: GHSA-rv95-896h-c2vc","Warn: Project is vulnerable to: GHSA-qw6h-vgh9-j6wx","Warn: Project is vulnerable to: GHSA-2j2x-2gpw-g8fm","Warn: Project is vulnerable to: GHSA-jchw-25xp-jwwc","Warn: Project is vulnerable to: GHSA-cxjh-pqwp-8mfp","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-4q6p-r6v2-jvc5","Warn: Project is vulnerable to: GHSA-ww39-953v-wcq6","Warn: Project is vulnerable to: GHSA-c7qv-q95q-8v27","Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22","Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-76p3-8jx3-jpfq","Warn: Project is vulnerable to: GHSA-3rfm-jhwj-7488","Warn: Project is vulnerable to: GHSA-hhq3-ff78-jv3g","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-92xj-mqp7-vmcj","Warn: Project is vulnerable to: GHSA-wxgw-qj99-44c2","Warn: Project is vulnerable to: GHSA-5rrq-pxf6-6jx5","Warn: Project is vulnerable to: GHSA-8fr3-hfg3-gpgp","Warn: Project is vulnerable to: GHSA-gf8q-jrpm-jvxq","Warn: Project is vulnerable to: GHSA-2r2c-g63r-vccr","Warn: Project is vulnerable to: GHSA-cfm4-qjh2-4765","Warn: Project is vulnerable to: GHSA-x4jg-mjrx-434g","Warn: Project is vulnerable to: GHSA-76c9-3jph-rj3q","Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j","Warn: Project is vulnerable to: GHSA-rhx6-c78j-4q9w","Warn: Project is vulnerable to: GHSA-h7cp-r72f-jxh6","Warn: Project is vulnerable to: GHSA-v62p-rq8g-8h59","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg","Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-wr3j-pwj9-hqq6","Warn: Project is vulnerable to: GHSA-4v9v-hfq4-rm2v","Warn: Project is vulnerable to: GHSA-9jgg-88mc-972h","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-17T04:56:54.809Z","repository_id":38310647,"created_at":"2025-08-17T04:56:54.809Z","updated_at":"2025-08-17T04:56:54.809Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28304263,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T11:18:18.743Z","status":"ssl_error","status_checked_at":"2026-01-11T11:07:56.842Z","response_time":60,"last_error":"SSL_read: 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":["reducers","redux-style","state-management","typescript","vandux-store","vanilla-js"],"created_at":"2024-10-04T14:23:26.871Z","updated_at":"2026-01-11T13:02:20.514Z","avatar_url":"https://github.com/benbowes.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Vandux\n\n![Build status](https://api.travis-ci.org/benbowes/redux-style-store-vanilla-js.svg?branch=master)\n\n**So you want a Redux solution for components, but have server rendered DOM you have no control over?**\n\nHere is an ES6 Pub/Sub pattern with a State Machine pattern combined with Reducers for said situation.\n\nWould I recommend using this over something like React on the server and client? Nope, I would not.\n\nWhat this will work well for, is those cases when you do not have a universal render, still need SEO compliance, and want predictable/testable state management.\n\n## Demo\n\nhttps://benbowes.github.io/vandux/dist/?vandux-debug\n\n## Codepen example\n\nhttps://codepen.io/benbowes/pen/RxrWBE\n\n## Getting started\n\n`npm install -D vandux` or `yarn add vandux`\n\nThen connect your html with a Vandux store. A full example can be found in here: https://github.com/benbowes/vandux/tree/master/src/examples\n\n**Note that Vandux is not currently intended to be a global store**, it is intended to be used at a component/module level. Providing your components with the ability to show you what happened when. You can have several Vandux stores, all working independently.\n\n## A Vandux code example\n\n#### Some html you'd like to \"connect\" with a Vandux store\n\n```html\n\u003cdiv class=\"wrapper\" data-vx=\"componentA\"\u003e\n  \u003cp\u003eName: \u003cspan data-vx=\"componentA__name\"\u003e\u003c/p\u003e\n  \u003cp\u003eTitle: \u003cspan data-vx=\"componentA__title\"\u003e\u003c/p\u003e\n\n  \u003cp\u003e\u003cinput type=\"text\" data-vx=\"componentA__update-name\" placeholder=\"Alter 'Name'\"\u003e\u003c/input\u003e\u003c/p\u003e\n  \u003cp\u003e\u003cinput type=\"text\" data-vx=\"componentA__update-title\" placeholder=\"Alter 'Title'\"\u003e\u003c/input\u003e\u003c/p\u003e\n\u003c/div\u003e\n```\n\nAssuming this folder structure for componentA ...\n```\n- componentA/\n  - reducer.js\n  - render.js\n  - index.js\n```\n\n#### Your entry file\n\n```js\nimport componentA from './componentA';\n\ndocument.addEventListener('DOMContentLoaded', () =\u003e {\n  componentA({ name: '', title: '' }); // Pass in initial state\n});\n```\n\n#### componentA/index.js\n\n```js\n// Component setup function.\n// Initial state is passed in to the component, connecting the component with the store.\n// It will render with it's initial state automatically using an action of type `INIT`.\n\nimport { createStore } from 'vandux';\nimport reducer from './reducer';\nimport render from './render';\n\n\n// Creates a relationship between event listeners and the store.\n\nfunction addListeners(el, store) {\n  el.querySelector('[data-vx=componentA__update-name]').addEventListener('keyup', e =\u003e\n    store.publish('UPDATE_NAME', { name: e.target.value }));\n\n  el.querySelector('[data-vx=componentA__update-title]').addEventListener('keyup', e =\u003e\n    store.publish('UPDATE_TITLE', { name: e.target.value }));\n}\n\n// Setup function, Connecting the component with the store.\n\nexport default (initialState) =\u003e {\n  const el = document.querySelector('[data-vx=\"componentA\"]');\n\n  const store = createStore({ reducer, initialState }).connect([\n    'UPDATE_NAME',\n    'UPDATE_TITLE'\n  ], el, render);\n\n  addListeners(el, store);\n};\n```\n\n#### componentA/reducer.js\n\n```js\nexport default function reducer(state = {}, action) {\n  switch (action.type) {\n\n    case 'UPDATE_NAME':\n      return { ...state, name: action.data.name };\n\n    case 'UPDATE_TITLE':\n      return { ...state, title: action.data.title };\n\n    default: return state;\n  }\n}\n```\n\n#### componentA/render.js\n\n```js\nlet $name;\nlet $title;\n\n// Render function - perform DOM manipulations in here.\n\nexport default function render(state, el, event) {\n  $name = $name || el.querySelector('[data-vx=componentA__name]');\n  $title = $title || el.querySelector('[data-vx=componentA__title]');\n\n  // Add data to the DOM\n\n  $title.textContent = state.title;\n  $name.textContent = state.name;\n}\n```\n\n## Debug mode\nAdd the query param `?vandux-debug=true` to your URL to see this kind of output in your browser console. It will show you what happened when, helping you debug race conditions.\n\n```js\nwrapper,componentB INIT {name: \"\", title: \"\"}\nwrapper,componentB UPDATE_NAME {name: \"a\", title: \"\"}}\nwrapper,componentB UPDATE_NAME {name: \"aa\", title: \"\"}\nwrapper,componentB UPDATE_NAME {name: \"aaa\", title: \"\"}\n```\nNote the first items are the values of the attributes on the html component - so you can identify which component published the event.\n\n## Thoughts on security\n\nIf you are planning to use this with `innerHTML`, be sure to use something like this to sanitise your html https://www.npmjs.com/package/sanitize-html.\n\nHappy coding!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenbowes%2Fvandux","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenbowes%2Fvandux","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenbowes%2Fvandux/lists"}