Skip to content

Instantly share code, notes, and snippets.

@danielpowell4
Created October 24, 2017 14:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielpowell4/490248199b5b815618b71821d3caef0c to your computer and use it in GitHub Desktop.
Save danielpowell4/490248199b5b815618b71821d3caef0c to your computer and use it in GitHub Desktop.
Starting shape of new react/redux note app
notes: {
byId: { // object keyed by Id
noteId: {
id: noteId,
content: noteContent,
...
}
},
creationForm: {
context: { // authorName / authorAvatar and permissions
authorName: "String Jenkins",
permission1: false,
...
},
display: { // show hide form and spinner/error data
showForm: false,
isFetching: bool,
...
},
},
isEditting: { // Controls note edit form
id: idBeingingEditted,
isSubmitting: isEditFormSubmittingBool
},
isFetching: false, // used to show spinner for initial load of first notes + filters
errorMessage: "", // used to populate alert
filters: {
active: "activeFilterName", // used to grab the collection of active notes
byName: { // object keyed by filterName that stores filter-specific data
filterName1: {
name: filterName1,
isFetching: bool,
lastFetchedAt: unixTimestamp,
noteIds: [noteId1, noteId2, noteId3...],
totalCount: noteCountFromAPI
},
...
},
allFilters: [filterName1, filterName2, ...] // used to populate the dropdown select
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment