{"id":15837024,"url":"https://github.com/afeiship/rtk-config-store","last_synced_at":"2026-05-01T14:33:46.209Z","repository":{"id":57122855,"uuid":"358904368","full_name":"afeiship/rtk-config-store","owner":"afeiship","description":"Redux toolkit config store with next.","archived":false,"fork":false,"pushed_at":"2024-07-28T09:13:35.000Z","size":57,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-22T22:10:08.605Z","etag":null,"topics":["config","global","redux","rtk","state","store","toolkit"],"latest_commit_sha":null,"homepage":"https://js.work/works/9ef82b41cca4f","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/afeiship.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2021-04-17T14:46:41.000Z","updated_at":"2024-07-28T09:13:38.000Z","dependencies_parsed_at":"2024-01-19T10:10:19.459Z","dependency_job_id":"53aea4f7-1247-4c13-9f2d-2d30f2063c80","html_url":"https://github.com/afeiship/rtk-config-store","commit_stats":{"total_commits":129,"total_committers":1,"mean_commits":129.0,"dds":0.0,"last_synced_commit":"2a4d2752eaa98219e744b21a85d091d34c5b5500"},"previous_names":["afeiship/rtk-config-store"],"tags_count":44,"template":false,"template_full_name":null,"purl":"pkg:github/afeiship/rtk-config-store","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afeiship%2Frtk-config-store","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afeiship%2Frtk-config-store/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afeiship%2Frtk-config-store/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afeiship%2Frtk-config-store/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/afeiship","download_url":"https://codeload.github.com/afeiship/rtk-config-store/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afeiship%2Frtk-config-store/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32501402,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"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":["config","global","redux","rtk","state","store","toolkit"],"created_at":"2024-10-05T15:20:31.206Z","updated_at":"2026-05-01T14:33:46.146Z","avatar_url":"https://github.com/afeiship.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rtk-config-store\n\u003e Redux toolkit config store with next.\n\n[![version][version-image]][version-url]\n[![license][license-image]][license-url]\n[![size][size-image]][size-url]\n[![download][download-image]][download-url]\n\n## installation\n```shell\nnpm install @jswork/rtk-config-store\n```\n\n## usage\n\u003e store.ts\n```ts\nimport { scanWebpack } from '@jswork/scan-modules';\nimport RtkConfigStore from '@jswork/rtk-config-store';\n\n// when webpack\nconst context = require.context('./modules', true, /\\.ts$/);\nconst modules = scanWebpack(context, { modules: '/modules/' });\nexport const store = RtkConfigStore({ modules, preloadedState: {}, reducer: {} });\n\n// Infer the `RootState` and `AppDispatch` types from the store itself\nexport type RootState = ReturnType\u003ctypeof store.getState\u003e;\n// Inferred type: {posts: PostsState, comments: CommentsState, users: UsersState}\nexport type AppDispatch = typeof store.dispatch;\n```\n\n\u003e app.ts\n```ts\nimport { Provider } from 'react-redux';\nimport { store } from '@/shared/stores/root';\n\ninterface IReduxProviderProps extends React.PropsWithChildren {}\n\nexport default function (props: IReduxProviderProps) {\n  const { children } = props;\n  return \u003cProvider store={store}\u003e{children}\u003c/Provider\u003e;\n}\n```\n\n\u003e define a slice use `nx.$createSlice`\n```ts\nexport default nx.$createSlice({\n  name: 'user',\n  initialState: {\n    token: null,\n    profile: JSON.parse(localStorage.getItem('profile'))\n  },\n  reducers: {\n    setToken: (state, action) =\u003e {\n      state.token = action.payload;\n    },\n    setProfile: (state, action) =\u003e {\n      state.profile = action.payload;\n    }\n  },\n  watch: {\n    profile: (newValue, oldValue, objectPath) =\u003e {\n      console.log('profile:', newVal, oldVal, objectPath);\n    }\n  }\n});\n```\n\n## types\n```ts\n/// \u003creference types=\"@jswork/rtk-config-store/global.d.ts\" /\u003e\n```\n\n## license\nCode released under [the MIT license](https://github.com/afeiship/rtk-config-store/blob/master/LICENSE.txt).\n\n[version-image]: https://img.shields.io/npm/v/@jswork/rtk-config-store\n[version-url]: https://npmjs.org/package/@jswork/rtk-config-store\n\n[license-image]: https://img.shields.io/npm/l/@jswork/rtk-config-store\n[license-url]: https://github.com/afeiship/rtk-config-store/blob/master/LICENSE.txt\n\n[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/rtk-config-store\n[size-url]: https://github.com/afeiship/rtk-config-store/blob/master/dist/index.min.js\n\n[download-image]: https://img.shields.io/npm/dm/@jswork/rtk-config-store\n[download-url]: https://www.npmjs.com/package/@jswork/rtk-config-store\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fafeiship%2Frtk-config-store","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fafeiship%2Frtk-config-store","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fafeiship%2Frtk-config-store/lists"}