Last active
April 27, 2018 04:58
-
-
Save JonathonAshworth/b2892bf4392c7ae75962ed69512397f5 to your computer and use it in GitHub Desktop.
Expanded vs Flat data
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const data = { | |
people: [ | |
{ | |
id: 0, | |
name: 'John', | |
bankAccount: { id: 0, balance: 2864 }, | |
address: { id: 0, number: 83, street: 'Foo St' }, | |
}, | |
{ | |
id: 1, | |
name: 'Steve', | |
bankAccount: { id: 1, balance: 97831 }, | |
address: { id: 0, number: 83, street: 'Foo St' }, | |
}, | |
], | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const data = { | |
people: [ | |
{ id: 0, name: 'John', bankAccount: 0, address: 1 }, | |
{ id: 1, name: 'Steve', bankAccount: 1, address: 0 }, | |
], | |
bankAccounts: [ | |
{ id: 0, balance: 2864 }, | |
{ id: 1, balance: 97831 }, | |
], | |
addresses: [ | |
{ id: 0, number: 83, street: 'Foo St' }, | |
], | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment