Skip to content

Instantly share code, notes, and snippets.

@scottcorgan
Created June 1, 2016 19:37
Show Gist options
  • Save scottcorgan/0c3e96425e9a1a8733cf5c1aada48fca to your computer and use it in GitHub Desktop.
Save scottcorgan/0c3e96425e9a1a8733cf5c1aada48fca to your computer and use it in GitHub Desktop.
// Brute force way to create infinitely nested lists.
// What's a better way to model this and store in db?
[
{id: 1, parenId: null},
{id: 2, parenId: null},
{id: 3, parenId: 2},
{id: 4, parenId: 2},
{id: 5, parenId: 1},
{id: 6, parenId: 1},
{id: 7, parenId: 1},
{id: 8, parenId: null}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment