{"id":27402300,"url":"https://github.com/danesirois/npm-redux-interfaces","last_synced_at":"2026-03-09T06:32:50.515Z","repository":{"id":18337346,"uuid":"83753687","full_name":"DaneSirois/npm-redux-interfaces","owner":"DaneSirois","description":"Redux API builder","archived":false,"fork":false,"pushed_at":"2022-12-06T18:04:29.000Z","size":127,"stargazers_count":5,"open_issues_count":5,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-08-24T10:12:29.641Z","etag":null,"topics":["interface","library","npm","redux","state-management"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/DaneSirois.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":"2017-03-03T03:35:54.000Z","updated_at":"2022-08-18T05:43:52.000Z","dependencies_parsed_at":"2023-01-11T19:50:11.430Z","dependency_job_id":null,"html_url":"https://github.com/DaneSirois/npm-redux-interfaces","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/DaneSirois/npm-redux-interfaces","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DaneSirois%2Fnpm-redux-interfaces","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DaneSirois%2Fnpm-redux-interfaces/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DaneSirois%2Fnpm-redux-interfaces/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DaneSirois%2Fnpm-redux-interfaces/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DaneSirois","download_url":"https://codeload.github.com/DaneSirois/npm-redux-interfaces/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DaneSirois%2Fnpm-redux-interfaces/sbom","scorecard":{"id":36611,"data":{"date":"2025-08-11","repo":{"name":"github.com/DaneSirois/npm-redux-interfaces","commit":"af47c78863c2108932fc396b418b5a9b6a0506db"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.9,"checks":[{"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":"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":"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":"Code-Review","score":0,"reason":"Found 1/24 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":"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":"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":"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 '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 16 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":1,"reason":"9 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-cwfw-4gq5-mrqx","Warn: Project is vulnerable to: GHSA-g95f-p29q-9xw4","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","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"],"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-14T20:28:00.634Z","repository_id":18337346,"created_at":"2025-08-14T20:28:00.634Z","updated_at":"2025-08-14T20:28:00.634Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274873613,"owners_count":25365824,"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","status":"online","status_checked_at":"2025-09-12T02:00:09.324Z","response_time":60,"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":["interface","library","npm","redux","state-management"],"created_at":"2025-04-14T04:25:03.699Z","updated_at":"2026-03-09T06:32:50.458Z","avatar_url":"https://github.com/DaneSirois.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Redux-Interfaces\n\u003e Domain based Redux architecture and API.\n\nInterfaces are wrappers around your Redux actions and reducers that provide an importable API for interacting with your applications state. Interfaces are organized by domain allowing for easier conceptualization of your state. Through the library you can access and subscribe to data directly from your reducers without the need for external bindings. Dispatching actions can be done from anywhere and becomes as simple as a function call.\n\n**Why interfaces**:\n\n- They reduce the amount of boilerplate needed for interacting with your store\n  - Say goodbye to bindings like `mapDistpatchToProps()`\n- They force you to think about the different domains in your app and model your state around them\n- They provide structure around your usage of Redux by giving you an easily repeatable and understandable architecture for adding new actions and reducers\n\n**Consumption**:\n\n- (*See [#Creating-an-interface](#creating-an-interface) for information on how to create an interface*)\n```js\nimport { RI } from 'npm-redux-interfaces';\n\n// DISPATCHING ACTIONS:\nRI.app.LOADING(true);\n\n// Get the state from the loading reducer:\nconst appIsLoading = RI.app.loading.getState();\n\n// Create a listener on the messages reducer:\nRI.chatroom.messages.listen((changes) =\u003e {\n  // Called on every change to the reducer\n  // made with the 'Chatroom_NEW_MESSAGE' action\n}, {}, [\n  'Chatroom_NEW_MESSAGE'\n]);\n\n// Add a message to a chatroom:\nRI.chatroom.NEW_MESSAGE({ text: 'My message' });\n```\n- (*See [#Creating-an-interface](#creating-an-interface) for more information on how to configure*)\n\n## Index:\n1. [Installation:](#installation)\n2. [Mirgrating to v3.0.0:](#migrating-from-v20-to-v30)\n3. [Usage:](#usage)\n4. [Configuration:](#configuration)\n5. [Creating an Interface:](#creating-an-interface)\n6. [API:](#api)\n7. [Dependencies:](#dependencies)\n8. [Author:](#author)\n9. [License:](#license)\n\n***\n## Installation:\n```\nnpm install --save npm-redux-interfaces\n```\n\n***\n## Migrating from v2.0 to v3.0:\n- see the [release notes](https://github.com/DaneSirois/npm-redux-interfaces/releases/tag/v3.0.0) for changes\n\n***\n## Usage:\n- (*See [#Creating-an-interface](#creating-an-interface) for information on how to configure an interface*)\n\n**Creating an interface**:\n```js\n/*[ /interfaces/App/App_index.js ]*/\n\nimport App_RENDER from './actions/App_RENDER.js';\n\nimport App_render from './reducers/App_render.js';\n\nexport default {\n  actions: {\n    RENDER: (bool) =\u003e App_RENDER(bool)\n  },\n  reducers: {\n    render: App_render\n  }\n};\n```\n- (*See [#Creating-an-interface](#creating-an-interface) for more information on how to configure*)\n\n**Connecting an interface**:\n```js\nimport { RI } from 'npm-redux-interfaces';\n\n// Import your interfaces:\nimport App_interface from './App/App_index';\n\n// Mount your interfaces:\nRI.mount('chatroom', Chatroom_interface);\n\n// Export the root_reducer:\nexport const root_reducer = RI.getRootReducer();\n```\n\n**Dispatching an action:**\n```js\nimport { RI } from 'npm-redux-interfaces';\n\nRI.chatroom.NEW_MESSAGE({ text: 'Cool!' });\n```\n\n**Accessing state from reducers:**\n```js\nimport { RI } from 'npm-redux-interfaces';\n\nconst messages = RI.chatroom.messages.getState();\n\n// Create a listener for a reducer and choose which actions should\n// trigger the updates:\nRI.chatroom.messages.listen((changes) =\u003e {\n  // Called on every state change in the reducer\n}, {}, [\n  'Chatroom_NEW_MESSAGE'\n]);\n\n// Pass optional prop to reducer listener to set number of calls:\nRI.chatroom.messages.listen((changes) =\u003e { ... }, {\n  numberOfCalls: 2\n}, [\n  'Chatroom_NEW_MESSAGE'\n]);\n\n// Pass optional prop to reducer listener to make it\n// always update. The default behaviour is it will\n// only update when the data changes.\nRI.chatroom.messages.listen((changes) =\u003e { ... }, {\n  alwaysUpdate: true\n}, [\n  'Chatroom_NEW_MESSAGE'\n]);\n```\n\n***\n## Configuration:\n- (*See [#Creating-an-interface](#creating-an-interface) for information on how to create an interface*)\n\n**[1]**: Create an *interfaces* folder off of the directory where you define your Redux store.\n\n**[2]**: Create an `index.js` file within your new *interfaces* folder. This file is where you will make the connection between your interfaces, and the library. At the end of this file, export the `root_reducer`.\n\n**[ src/interfaces/index.js ]:**\n```js\nimport { RI } from 'npm-redux-interfaces';\n\n// Import your interfaces:\nimport Chatroom_interface from './Chatroom/Chatroom_index';\n\n// Mount your interfaces:\nRI.mount('chatroom', Chatroom_interface);\n\n// Export the root_reducer:\nexport const root_reducer = RI.getRootReducer();\n```\n\n**[3]**: Navigate to your apps root `index.js` file and create the store. Immediately after definition, pass in reference to it with `RI.setStore()`.\n\n**[ src/index.js ]:**\n```js\nimport { RI } from 'npm-redux-interfaces';\nimport { root_reducer } from './interfaces/index.js';\n\n// Create the store:\nconst store = applyMiddleware(...middleware)(createStore)(root_reducer);\n\n// Pass reference to it:\nRI.setStore(store);\n```\n\n**Your app is now ready to mount interfaces**.\n***\n## Creating an Interface:\n\n**[1]**: Create a new folder for your interface inside of the `/interfaces` directory:\n- It's convention to capitalize the first letter of the interface folders name (**ex**: `Chatroom`).\n\n[2]: Inside of this new folder, create a **types** file:\n- *It's convention to name your constants with the name of the interface appended with the type in all capitals.*\n\n**[ src/interfaces/Chatroom/Chatroom_types.js ]:**\n```js\nexport const Chatroom_NEW_MESSAGE = 'Chatroom_NEW_MESSAGE';\n```\n\n**[3]**: Create sub directories for your *actions* and *reducers*:\n\n**[ src/interfaces/Chatroom/actions/Chatroom_NEW_MESSAGE.js ]:**\n```js\nimport { Chatroom_NEW_MESSAGE } from '../Chatroom_types.js';\n\nexport default (message) =\u003e {\n  return {\n    type: Chatroom_NEW_MESSAGE,\n    payload: {\n      message\n    }\n  };\n};\n```\n\n**[ src/interfaces/Chatroom/reducers/Chatroom_messages.js ]:**\n```js\nimport { Chatroom_NEW_MESSAGE } from '../Chatroom_types.js';\n\nexport default (state = false, action) =\u003e {\n  switch(action.type) {\n    case Chatroom_NEW_MESSAGE:\n      return state.concat([action.payload]);\n    default:\n      return state;\n  };\n};\n```\n\n**[4]**: Create the entry point for your interface. This is where you build and expose it's public API.\n\n- *This file **must** export an object that contains the keys **actions**, and **reducers**. It's okay to omit either key, but know that their presence is required if you wish to use that part of your interface.*\n- *Your actions **must** be named in all caps. This is what differentiates them from your reducers.*\n\n**[ src/interfaces/Chatroom/Chatroom_index.js ]:**\n```js\nimport Chatroom_NEW_MESSAGE from './actions/Chatroom_NEW_MESSAGE.js';\n\nimport Chatroom_messages from './reducers/Chatroom_messages.js';\n\nexport default {\n  actions: {\n    NEW_MESSAGE: (message) =\u003e Chatroom_NEW_MESSAGE(message)\n  },\n  reducers: {\n    messages: Chatroom_messages\n  }\n};\n```\n\n**If you followed all of the steps correctly, you should now how have a directory which mimics the following**:\n\n![Chatroom_interface](https://i.imgur.com/I6pANw7.png)\n\n***\n## API:\n## RI.mount([*string*], [*object*]):\nThis method mounts your interface into to the library giving you access to it's internal API.\n- As convention, namespace your interfaces using lowercase.\n\n**Arguments**([*1*], [*2*]):\n\n1. [*interface_name*]:\n    - A string which gets used as the namespace for your interface.\n2. [*interface_object*]:\n    - An object containing the API of your interface.\n\n**Returns**: [ *null* ]\n\n**Example**:\n```js\nRI.mount('chatroom', Chatroom_interface);\n```\n\n***\n## RI.getRootReducer():\nThis method returns the `root_reducer` of your app.\n- Usually you will want to immediately export this for use when defining your store.\n\n**Arguments**( ): [ *none* ]\n\n**Returns**: [ *function* ]\n\n**Example**:\n```js\nexport const root_reducer = RI.getRootReducer();\n```\n\n***\n## RI.setStore([*object*]):\nThis method gives the library access to your redux store allowing it to internally dispatch actions and access reducer state.\n\n- Immediately after instantiating your Redux store, pass reference to it with this method.\n\n**Arguments**([1]):\n\n1. [*store*]:\n    - The object created upon instantiating your Redux store from inside of your app's root level *index.js* file.\n\n**Returns**: [ *null* ]\n\n**Example**:\n```js\nconst store = applyMiddleware(...middleware)(createStore)(root_reducer);\n\nRI.setStore(store);\n```\n***\n## RI.getStore():\nThis method returns the store object initially passed in from the `RI.setStore()` method.\n\n**Arguments**( ):\n\n**Returns**: [ *object* ]\n\n**Example**:\n```js\nconst reduxStore = RI.getStore();\n```\n\n***\n## Dependencies:\n1. **redux**\n\n## Author:\n**[Dane Sirois](https://www.linkedin.com/in/dane-sirois/)**\n\n## License:\n**[MIT](https://opensource.org/licenses/MIT)**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanesirois%2Fnpm-redux-interfaces","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanesirois%2Fnpm-redux-interfaces","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanesirois%2Fnpm-redux-interfaces/lists"}