Skip to content

Instantly share code, notes, and snippets.

@bdushimi
Created October 2, 2019 15:32
Show Gist options
  • Save bdushimi/f2543624af14e0e27cfc1a95597bd2eb to your computer and use it in GitHub Desktop.
Save bdushimi/f2543624af14e0e27cfc1a95597bd2eb to your computer and use it in GitHub Desktop.
A Non-Normalised Store
const blogPosts = [
{
id: 'post1',
author: { username: 'user1', name: 'User 1' },
body: '......',
comments: [
{
id: 'comment1',
author: { username: 'user2', name: 'User 2' },
comment: '.....'
},
{
id: 'comment2',
author: { username: 'user3', name: 'User 3' },
comment: '.....'
}
]
},
{
id: 'post2',
author: { username: 'user2', name: 'User 2' },
body: '......',
comments: [
{
id: 'comment3',
author: { username: 'user3', name: 'User 3' },
comment: '.....'
},
{
id: 'comment4',
author: { username: 'user1', name: 'User 1' },
comment: '.....'
},
{
id: 'comment5',
author: { username: 'user3', name: 'User 3' },
comment: '.....'
}
]
}
// and repeat many times
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment