{"id":39186429,"url":"https://github.com/d1slike/redux-utils","last_synced_at":"2026-01-17T22:39:30.293Z","repository":{"id":29551550,"uuid":"122024975","full_name":"d1slike/redux-utils","owner":"d1slike","description":"Lightweight, no dependency library for redux reducers","archived":false,"fork":false,"pushed_at":"2022-12-07T10:25:07.000Z","size":850,"stargazers_count":5,"open_issues_count":16,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-08-21T14:49:34.002Z","etag":null,"topics":["react","react-native","reducer-creation","reducers","redux","state","utils"],"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/d1slike.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":"2018-02-19T06:05:31.000Z","updated_at":"2020-07-18T06:29:25.000Z","dependencies_parsed_at":"2023-01-14T15:15:29.976Z","dependency_job_id":null,"html_url":"https://github.com/d1slike/redux-utils","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/d1slike/redux-utils","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d1slike%2Fredux-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d1slike%2Fredux-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d1slike%2Fredux-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d1slike%2Fredux-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/d1slike","download_url":"https://codeload.github.com/d1slike/redux-utils/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d1slike%2Fredux-utils/sbom","scorecard":{"id":315578,"data":{"date":"2025-08-11","repo":{"name":"github.com/d1slike/redux-utils","commit":"1fdd415ca711604c430bbb63cf285f785383a931"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/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":"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":"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":"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":"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":"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":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 4 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":"56 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-6chw-6frg-f759","Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","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-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-rq8g-5pc5-wrhr","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-hr2v-3952-633q","Warn: Project is vulnerable to: GHSA-qrmc-fj45-qfc2","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-8r6j-v8pm-fqw3","Warn: Project is vulnerable to: MAL-2023-462","Warn: Project is vulnerable to: GHSA-xf7w-r453-m56c","Warn: Project is vulnerable to: GHSA-4q6p-r6v2-jvc5","Warn: Project is vulnerable to: GHSA-765h-qjxv-5f44","Warn: Project is vulnerable to: GHSA-f2jv-r9rf-7988","Warn: Project is vulnerable to: GHSA-44pw-h2cw-w3vq","Warn: Project is vulnerable to: GHSA-jp4x-w63m-7wgm","Warn: Project is vulnerable to: GHSA-c429-5p7v-vgjp","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-2pr6-76vf-7546","Warn: Project is vulnerable to: GHSA-8j8c-7jfh-h6hx","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-6c8f-qphg-qjgp","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-4xcv-9jjx-gfj3","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-fhjf-83wg-r2j9","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-g6ww-v8xp-vmwg","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-6g33-f262-xjp4","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-4g88-fppr-53pp","Warn: Project is vulnerable to: GHSA-4jqc-8m5r-9rpr","Warn: Project is vulnerable to: GHSA-2m39-62fm-q8r3","Warn: Project is vulnerable to: GHSA-mf6x-7mm4-x2g7","Warn: Project is vulnerable to: GHSA-j44m-qm6p-hp7m","Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9","Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh","Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp"],"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-18T00:07:16.682Z","repository_id":29551550,"created_at":"2025-08-18T00:07:16.682Z","updated_at":"2025-08-18T00:07:16.682Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28521165,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T22:11:28.393Z","status":"ssl_error","status_checked_at":"2026-01-17T22:11:27.841Z","response_time":85,"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":["react","react-native","reducer-creation","reducers","redux","state","utils"],"created_at":"2026-01-17T22:39:30.223Z","updated_at":"2026-01-17T22:39:30.283Z","avatar_url":"https://github.com/d1slike.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# redux-reducer-utils\n\n[![npm version](https://badge.fury.io/js/redux-reducer-utils.svg)](https://badge.fury.io/js/redux-reducer-utils)\n[![Build Status](https://travis-ci.org/d1slike/redux-utils.svg?branch=master)](https://travis-ci.org/d1slike/redux-utils)\n[![Coverage Status](https://coveralls.io/repos/d1slike/redux-utils/badge.svg?branch=master)](https://coveralls.io/r/d1slike/redux-utils?branch=master)\n\nLightweight, no dependency library for redux reducers\n\n* [Install](#install)\n* [Reducer creator](#reducer-creation)\n* [Reducer composer](#reducer-composition)\n\n## Install\n```\nnpm install --save redux-reducer-utils\n```\nOr\n```\nyarn add redux-reducer-utils\n```\n## Usage\n\n### Reducer creation\n``createReducer`` provides more declarative way to describe redux reducer\n\nJust call ``createReducer`` with initial state as argument and then\ninvoke chain ``when`` to register actions handlers, finally call ``toFunction`` to build reducer\n\n```javascript\nimport {createReducer} from 'redux-reducer-utils';\n\nconst initialState = {\n    a: 1,\n    b: 2,\n    c: 3,\n    d: 4,\n};\n\nconst reducer = createReducer(initialState)\n    .when(ACTION_TYPE_1, (state, action) =\u003e ({\n        ...state,\n        a: state.a + action.payload,\n    }))\n    .when(ACTION_TYPE_4, (state, action) =\u003e ({\n        ...state,\n        c: state.c + action.payload,\n    }))\n    .toFunction();\n```\n\nHere comparison classic reducer description with ``createReducer`` way\n```javascript\nconst ACTION_TYPE_1 = 'ACTION_TYPE_1';\nconst ACTION_TYPE_2 = 'ACTION_TYPE_2';\nconst ACTION_TYPE_3 = 'ACTION_TYPE_3';\nconst ACTION_TYPE_4 = 'ACTION_TYPE_4';\n\nconst initialState = {\n    a: 1,\n    b: 2,\n    c: 3,\n    d: 4,\n};\n\nconst classicReducer = (state = initialState, action) =\u003e {\n    switch (action.type) {\n        case ACTION_TYPE_1:\n            return {\n                ...state,\n                a: state.a + action.payload,\n            };\n        case ACTION_TYPE_2:\n        case ACTION_TYPE_3:\n            return {\n                ...state,\n                b: state.b + action.payload,\n            };\n        case ACTION_TYPE_4:\n            return {\n                ...state,\n                c: state.c + action.payload,\n            };\n        default:\n            return state;\n    }\n};\n\nconst withCreateReducer = createReducer(initialState)\n    .when(ACTION_TYPE_1, (state, action) =\u003e ({\n        ...state,\n        a: state.a + action.payload,\n    })) //if you need the same handler for two or more actions types, just put array to first argument\n    .when([ACTION_TYPE_2, ACTION_TYPE_3], (state, action) =\u003e ({\n        ...state,\n        b: state.b + action.payload,\n    }))\n    .when(ACTION_TYPE_4, (state, action) =\u003e ({\n        ...state,\n        c: state.c + action.payload,\n    }))\n    .toFunction();\n```\n\n### Reducer composition\n\n``composeReducers`` This function can help with reducers horizontal scaling\n\nEvery _i_ reducer has access to _i-1_ state\n```javascript\nimport {composeReducers} from 'redux-reducer-utils';\n\nconst SOME_ACTION = 'SOME_ACTION';\n\nconst initialStateFirst = {\n    a: 1,\n    b: 2,\n};\n\nconst initialStateSecond = {\n    c: 3,\n    d: 3,\n};\n\nconst firstReducer = (state = initialStateFirst, action) =\u003e {\n    //...some actions handlers\n};\n\nconst secondReducer = (state = initialStateSecond, action) =\u003e {\n    //...here you have access to state from firstReducer\n    switch (action.type) {\n        case SOME_ACTION:\n            return {\n                ...state,\n                a: state.a + action.payload,\n            };\n        default:\n            return state;\n    }\n};\n\nexport const composedReducer = composeReducers(firstReducer, secondReducer, /*...any number of reducers*/);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd1slike%2Fredux-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fd1slike%2Fredux-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd1slike%2Fredux-utils/lists"}