You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I know TCA is not prescriptive around naming, which I think is a good thing, but I also wonder if anyone has strong ideas about how they name features in their projects? For example, take a simple note-taking app where you have a list of notes. You can tap into each note to view it and for the sake of this example, you have to edit the note in a separate screen. What I struggle with a bit is not wanting to name the reducers the same as the domain models, so I often do something like this (where bold is a folder).
Notes
List
NotesList.swift
NotesListView.swift
NotesListRowView.swift
Detail
NoteDetail.swift
NoteDetailView.swift
Edit
EditNote.swift
EditNoteView.swift
I like to group all related features in a folder like Notes to separate from other features (assuming later there might be Tags, Folders, etc) and make it easy to extract to a separate package later. Then within a feature, create a directory for each sub-feature which gives a place for related types (e.g. - NotesListRowView). This generally works well for me and I find it nice to have a consistent pattern, but I would love to hear how anyone else would structure this app.
Though we don't need to use standardize on naming conventions, if there was a generally accepted approach, I think it would be helpful. I could see their being a separate package (or possibly ship with TCA) that simplifies scaffolding/generating new features, much like Rails.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I know TCA is not prescriptive around naming, which I think is a good thing, but I also wonder if anyone has strong ideas about how they name features in their projects? For example, take a simple note-taking app where you have a list of notes. You can tap into each note to view it and for the sake of this example, you have to edit the note in a separate screen. What I struggle with a bit is not wanting to name the reducers the same as the domain models, so I often do something like this (where bold is a folder).
I like to group all related features in a folder like Notes to separate from other features (assuming later there might be Tags, Folders, etc) and make it easy to extract to a separate package later. Then within a feature, create a directory for each sub-feature which gives a place for related types (e.g. - NotesListRowView). This generally works well for me and I find it nice to have a consistent pattern, but I would love to hear how anyone else would structure this app.
Though we don't need to use standardize on naming conventions, if there was a generally accepted approach, I think it would be helpful. I could see their being a separate package (or possibly ship with TCA) that simplifies scaffolding/generating new features, much like Rails.
Beta Was this translation helpful? Give feedback.
All reactions