Cursor rule
.cursor/rules/reduxing.mdc[object Object]
Cursor rules
Quality
45/100
Scores the file, not the repository.Length
138 words
3 headings · 1 code blocksRepository
0
— · pushed 377 days agoLast changed
3 days ago
First indexed 3 days ago.123456# 状态管理规范78## 1. Redux Toolkit 使用规范9```typescript10// features/auth/authStore.ts11import { createSlice, createAsyncThunk } from '@reduxjs/toolkit';1213// 异步 action14export const fetchUserInfo = createAsyncThunk(15 'user/fetchUserInfo',16 async (userId: string) => {17 const response = await fetchUserById(userId);18 return response.data;19 }20);2122// slice 定义23const userSlice = createSlice({24 name: 'user',25 initialState: {26 userInfo: null,27 loading: false,28 error: null,29 },30 reducers: {31 clearUser: (state) => {32 state.userInfo = null;33 },34 },35 extraReducers: (builder) => {36 builder37 .addCase(fetchUserInfo.pending, (state) => {38 state.loading = true;39 })40 .addCase(fetchUserInfo.fulfilled, (state, action) => {41 state.loading = false;42 state.userInfo = action.payload;43 })44 .addCase(fetchUserInfo.rejected, (state, action) => {45 state.loading = false;46 state.error = action.error.message;47 });48 },49});5051export const { clearUser } = userSlice.actions;52export default userSlice.reducer;53```5455## 2. 状态管理最佳实践56- 使用 `createSlice` 定义状态和 reducers57- 异步操作使用 `createAsyncThunk`58- 避免在组件中直接修改状态59- 使用 `useSelector` 获取状态,`useDispatch` 派发 action60
Also in crunl/Xingyu-Frontend
Diff this repo’s formatsOne repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| crunl/Xingyu-Frontend.cursor/rules/api.mdc · 0 | Cursor rules | api | 45/100 | 3 days ago | |
| crunl/Xingyu-Frontend.cursor/rules/comments.mdc · 0 | Cursor rules | securityapidocs | 46/100 | 3 days ago | |
| crunl/Xingyu-Frontend.cursor/rules/componenting.mdc · 0 | Cursor rules | no sections | 45/100 | 3 days ago | |
| crunl/Xingyu-Frontend.cursor/rules/naming.mdc · 0 | Cursor rules | archtypesapiui | 58/100 | 3 days ago | |
| crunl/Xingyu-Frontend.cursor/rules/project.mdc · 0 | Cursor rules | no sections | 50/100 | 3 days ago | |
| crunl/Xingyu-Frontend.cursor/rules/routing.mdc · 0 | Cursor rules | no sections | 53/100 | 3 days ago | |
| crunl/Xingyu-Frontend.cursor/rules/styling.mdc · 0 | Cursor rules | archui | 54/100 | 3 days ago | |
| crunl/Xingyu-Frontend.cursor/rules/typescript.mdc · 0 | Cursor rules | typesdocs | 42/100 | 3 days ago |
Diff against .cursor/rules/api.mdc Diff against .cursor/rules/comments.mdc Diff against .cursor/rules/componenting.mdc Diff against .cursor/rules/naming.mdc Diff against .cursor/rules/project.mdc Diff against .cursor/rules/routing.mdc Diff against .cursor/rules/styling.mdc Diff against .cursor/rules/typescript.mdc
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| hiromaily/go-crypto-wallet.cursor/rules/typescript.mdc · 126 | Cursor rules | setupbuildtestlint-format+6 | 100/100 | 3 days ago | |
| TechSquidTV/Hermes.cursor/rules/10-hermes-api.mdc · 45 | Cursor rules | testlint-formatstylearch+5 | 100/100 | 3 days ago | |
| markstev/mark-starter.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+6 | 99/100 | 3 days ago | |
| Allymahmoud/case-intake-platform.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| dodgecfr/combatfilms-webapp.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| deifos/clipmira-subtitles.cursor/rules/frontend.mdc · 1 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| langflow-ai/langflow.cursor/rules/docs_development.mdc · 153k | Cursor rules | setupbuildtestlint-format+7 | 97/100 | 3 days ago | |
| TechSquidTV/Hermes.cursor/rules/20-hermes-api-tests.mdc · 45 | Cursor rules | teststyletesting-strategysecurity+3 | 97/100 | 3 days ago |
