Skip to content

Instantly share code, notes, and snippets.

@bdushimi
bdushimi / NonNormalisedStore.js
Created October 2, 2019 15:32
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: '.....'
@bdushimi
bdushimi / NormalisedStore.js
Created October 2, 2019 15:30
Normalised Redux Store
{
posts : {
byId : {
"post1" : {
id : "post1",
author : "user1",
body : "......",
comments : ["comment1", "comment2"]
},
"post2" : {