{"id":38237044,"url":"https://github.com/duan602728596/umi-plugin-redux-toolkit","last_synced_at":"2026-01-17T01:07:04.049Z","repository":{"id":57385683,"uuid":"308590489","full_name":"duan602728596/umi-plugin-redux-toolkit","owner":"duan602728596","description":"Umi plugin, use @reduxjs/toolkit. -  umi的插件，使用@reduxjs/toolkit。","archived":false,"fork":false,"pushed_at":"2023-12-04T10:57:09.000Z","size":1500,"stargazers_count":4,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-09T18:09:28.665Z","etag":null,"topics":["umi","umi-plugin","umi3","umi4","umijs"],"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/duan602728596.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,"governance":null}},"created_at":"2020-10-30T10:01:25.000Z","updated_at":"2023-06-01T03:59:54.000Z","dependencies_parsed_at":"2023-12-04T11:47:51.765Z","dependency_job_id":null,"html_url":"https://github.com/duan602728596/umi-plugin-redux-toolkit","commit_stats":{"total_commits":211,"total_committers":2,"mean_commits":105.5,"dds":"0.018957345971563955","last_synced_commit":"ddbfe67bece996dddb857d8978b5204770607531"},"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"purl":"pkg:github/duan602728596/umi-plugin-redux-toolkit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duan602728596%2Fumi-plugin-redux-toolkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duan602728596%2Fumi-plugin-redux-toolkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duan602728596%2Fumi-plugin-redux-toolkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duan602728596%2Fumi-plugin-redux-toolkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/duan602728596","download_url":"https://codeload.github.com/duan602728596/umi-plugin-redux-toolkit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duan602728596%2Fumi-plugin-redux-toolkit/sbom","scorecard":{"id":358801,"data":{"date":"2025-08-11","repo":{"name":"github.com/duan602728596/umi-plugin-redux-toolkit","commit":"f2a1513201aafe92c0bb416f3ac365309585b34a"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"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":"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":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 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":"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":"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":"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":"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":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"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'","Warn: branch protection not enabled for branch 'v1'"],"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"}}]},"last_synced_at":"2025-08-18T10:16:10.770Z","repository_id":57385683,"created_at":"2025-08-18T10:16:10.770Z","updated_at":"2025-08-18T10:16:10.770Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28490985,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T00:50:05.742Z","status":"ssl_error","status_checked_at":"2026-01-17T00:43:11.982Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["umi","umi-plugin","umi3","umi4","umijs"],"created_at":"2026-01-17T01:07:02.898Z","updated_at":"2026-01-17T01:07:04.029Z","avatar_url":"https://github.com/duan602728596.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# umi-plugin-redux-toolkit\n\n[中文文档](README_zhCN.md)\n\nThe plugin of umi@4 uses @reduxjs/toolkit.\n\n## Install and use\n\nIf you want to use plugin, you must install first.\n\n```\nyarn add umi-plugin-redux-toolkit @reduxjs/toolkit\n// or\nnpm install umi-plugin-redux-toolkit @reduxjs/toolkit\n```\n\nFinish installed, you may [enable the plugin](https://umijs.org/docs/guides/plugins#%E5%90%AF%E7%94%A8%E6%8F%92%E4%BB%B6).\n\n## Configuration\n\n* ignoreOptions { object } : Configure ignored options, refer to   \n  [https://redux-toolkit.js.org/api/serializabilityMiddleware](https://redux-toolkit.js.org/api/serializabilityMiddleware),   \n  When the object in redux may be created from `new Class`, or other non-serializable values,   \n  there will be a warning when the action is obtained or called, and this option can be configured to ignore the warning.\n  * ignoreOptions.ignoredPaths { Array\u0026lt;string\u0026gt; } : Ignore value.\n  * ignoreOptions.ignoredActions  { Array\u0026lt;string\u0026gt; } : Ignored actions.\n\n* modelName { string } : Customize the name of the model folder and ignore the singular configuration after configuration.\n* singular { boolean } : Whether the directory is singular.\n* esModule { boolean } : Import using the es6 module method.\n* ignore { string | Array\u003cstring\u003e } : Ignored model files. (Refer to the [ignore](https://www.npmjs.com/package/glob#options) configuration of glob)\n* asyncLoadReducers { boolean } : Enable the function of asynchronously injecting reducers.   \n  (Need to manually mount on the component, it will be more troublesome, so it is not recommended).\n\n### How to configure\n\n```javascript\n// .umirc.js or umi.config.js\nimport { defineConfig } from 'umi';\n\nexport default {\n  // Configuration of umi-plugin-redux-toolkit\n  reduxToolkit: {\n    esModule: true\n  }\n};\n```\n\n## How to use\n\nCreate the `models` folder, create a ts or js file under the folder, and export the slice created by createSlice, or the configuration of createSlice.   \nExport slice [Reference](https://github.com/duan602728596/umi-plugin-redux-toolkit/blob/main/example/src/pages/models/add.js),\nExport the configuration of createSlice [Reference](https://github.com/duan602728596/umi-plugin-redux-toolkit/blob/main/example/src/pages/models/index.js).   \n\n```javascript\nimport { createSlice } from '@redux/toolkit';\n\nconst slice = createSlice({\n  name: 'sliceName',\n  initialState: { value: 0 },\n  reducers: {\n    addValue(state, action) {\n      state.value++;\n    }\n  }\n});\n\nconst { addValue } = slice.actions;\n\nexport default slice;\n```\n\nWhen exporting the configuration of createSlice, if the reduce key is created by createAction, the namespace will be automatically removed. E.g:\n\n```javascript\nimport { createAction } from '@redux/toolkit';\n\nconst action = createAction('sliceName/action');\n\nexport default {\n  name: 'sliceName',\n  initialState: { value: 0 },\n  reducers: {\n    // will automatically change index/action into action\n    [action](state, action) {\n      return state;\n    }\n  }\n};\n```\n\nNow also supports exporting APIs created by RTK RTKQuery. E.g:\n\n```javascript\nimport { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react';\n\nconst api = createApi({\n  reducerPath: 'api',\n  baseQuery: fetchBaseQuery({ baseUrl: '/' }),\n  endpoints(builder) {\n    return {\n      getData: builder.query({\n        query: (q) =\u003e q\n      })\n    };\n  }\n});\n\nexport const { useGetDataQuery } = api;\nexport default api;\n```\n\nExporting listenerMiddleware is now also supported. E.g:\n\n```javascript\nimport { createListenerMiddleware } from '@reduxjs/toolkit';\nimport { setAction } from './actions';\n\nconst listenerMiddleware = createListenerMiddleware();\n\nlistenerMiddleware.startListening({\n  actionCreator: setAction,\n  effect(action, listenerApi) {\n    console.log('Listener: setAction');\n  }\n});\n\nexport default listenerMiddleware;\n```\n\n## Initial value\n\nExport in app.js\n\n```javascript\nexport const reduxToolkit = {\n  initialState: {},    // Initialize the value of redux\n  ignoreOptions: {},   // Same as the ignoreOptions configuration above, it will be merged\n  warnAfter: 800,      // If the check time of immutableCheck and serializableCheck exceeds 32ms, there will be a warning. Modify the warning time\n  reducers: {},        // Custom add reducers\n  middlewares: [],     // Custom add middlewares\n  treatStore(store) {} // Allows you to perform other processing on the store, such as mounting some monitoring methods\n};\n\n// or\n\nexport function reduxToolkit() {\n  return {\n    initialState: () =\u003e ({}), // It can also be a function to initialize the value of redux\n    ignoreOptions: {},        // Same as the ignoreOptions configuration above, it will be merged\n    warnAfter: 800,           // If the check time of immutableCheck and serializableCheck exceeds 32ms, there will be a warning. Modify the warning time\n    reducers: {},             // Custom add reducers\n    middlewares: [],          // Custom add middlewares\n    treatStore(store) {}      // Allows you to perform other processing on the store, such as mounting some monitoring methods\n  };\n}\n```\n\n## Asynchronous injection of reducers\n\nThe `*.async.{js,jsx,ts,tsx}` files in the models folder will be considered as asynchronously injected reducers and will not be automatically loaded.   \nConfigure `asyncLoadReducers: true` to enable asynchronous injection of reducers.   \n\nApi created by RTK RTKQuery cannot be loaded asynchronously because it needs to add middleware.\n\n```javascript\nimport { dynamicReducers } from 'umi-plugin-redux-toolkit/dynamicReducers';\nimport model_0 from './models/model_0';\nimport model_1 from './models/model_1';\n\nfunction Component(props) {\n return \u003cdiv /\u003e;\n}\n\nexport default dynamicReducers([model_0, model_1])(Component); // Multiple models pass array\n// or\nexport default dynamicReducers(model_0)(Component); // Single model\n```\n\n## Get the store object\n\nYou can get the store object in the following way:\n\n```javascript\nimport { store } from '@@/plugin-reduxToolkit/store';\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fduan602728596%2Fumi-plugin-redux-toolkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fduan602728596%2Fumi-plugin-redux-toolkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fduan602728596%2Fumi-plugin-redux-toolkit/lists"}