Sample State
Closed this issue · 5 comments
xnanodax commented
Sample State
- State shape is flat!
- State's keys are camelCased
- All keys within the values in the state are accessible in the schema (Ex: if you create a
img_url
key in the state, make sure your database also has a column that contains animg_url
) - Correctly formatted
- Sample state is rendered with 3 back ticks before and after. This will display the state as a code block instead of a giant line of text
- Top level slices
-
entities
-
session
-
errors
(here or inui
) -
ui
(if needed)
-
- Should NOT have nested slices, aka
comments
inside ofposts
- Some info from other tables is ok, for instance:
- the author username and imageurl for a post. basically any info that the user can't change
- like count and a boolean on whether the user likes the post instead of a likes slice
- Some info from other tables is ok, for instance:
Comments:
- In your user slice of state, you may just want to record who a user follows instead of the photo ids they have liked.
- You may want to reference comment ids on the photos slice of state. it'll be easier to iterate through that array instead of searching for comments that have a specific image id.
xnanodax commented
Initial Proposal for this page has been reviewed.
bergieboy commented
Added comment Ids to the photo slice of state. I also added followers to the user slice of state - can we discuss this one later today, so have a better understanding of what you mean?
xnanodax commented
Yes, we can! I think the current state has a user that is following themselves. Is this a function in Instagram?
bergieboy commented
lol no, I was quickly throwing in identical arrays. sry.
xnanodax commented
reminder!
- Sample followers in user's slice of state.
- Sample users' likes in photos slice of state.
Awesome!