- Issue created by @larowlan
- πΊπΈUnited States hooroomoo
From https://redux.js.org/style-guide/#structure-files-as-feature-folders-wit...
Redux itself does not care about how your application's folders and files are structured. However, co-locating logic for a given feature in one place typically makes it easier to maintain that code.
Because of this, we recommend that most applications should structure files using a "feature folder" approach (all files for a feature in the same folder). Within a given feature folder, the Redux logic for that feature should be written as a single "slice" file, preferably using the Redux Toolkit createSlice API. (This is also known as the "ducks" pattern). While older Redux codebases often used a "folder-by-type" approach with separate folders for "actions" and "reducers", keeping related logic together makes it easier to find and update that code.
This was under "Strongly recommended" so maybe we should keep the feature folder approach.
- π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
Sorry for the confusion, I'm not proposing moving away from that, rather just putting the reducers out of the create slice method to keep that file manageable
Example https://git.drupalcode.org/project/decoupled_lb/-/blob/1.x/packages/deco...
- Assigned to hooroomoo
- πΊπΈUnited States hooroomoo
I had added my edited comment before I read #4! Speedy.
Thinking about this again, I don't think it's necessary to split up the reducers at this stage. The two slice files we have aren't that large right now. In this early stage of development it'll be smoother to make changes when we can see all the reducers all at once and see what each one does in relation to each other without having to navigate to a different file for each one.
- Assigned to larowlan
- Status changed to Postponed: needs info
17 days ago 7:24am 12 June 2024 - Status changed to Closed: won't fix
16 days ago 9:47pm 12 June 2024 - π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
Ok, let's tackle it when it becomes an issue