hackafy | Instagram clone built with React and Redux | User Interface library
kandi X-RAY | hackafy Summary
kandi X-RAY | hackafy Summary
Instagram clone SPA (single-page-application), in an effort to learn modern JS libraries. Demo: Hosted on Heroku.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of hackafy
hackafy Key Features
hackafy Examples and Code Snippets
Community Discussions
Trending Discussions on hackafy
QUESTION
I'm retrieving data from a backend, the data structure is like this.
Data Strucuture
...ANSWER
Answered 2019-Jul-23 at 20:20You should normalize your state as explained in the redux docs. The key points:
- You should keep your store as flat as possible
- Try to reduce duplicate information => only set ids references instead of actual data
don't use arrays to store your data, because you will have to use find or filter a lot, instead use a map/object with the key as the access point to the actual object like this:
comments: {comment_id1: {title: 'title', author:'author_id'}}
to get all comments, add a allComments array with only the ids like this
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install hackafy
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page