Last active
October 20, 2015 11:59
-
-
Save gugl/80c348e95c9ade3f0101 to your computer and use it in GitHub Desktop.
Whats the best store tree structure so that it still make sense to use combineReducers?
This file contains hidden or 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
var example = { | |
selectedTodoList: 'tl-1', | |
todosByTodoList: { | |
'tl-1': { | |
lastUpdated: 1439478405547, | |
items: ['t-1', 't-2'] | |
} | |
}, | |
attachmentsByTodo: { | |
't-1': { | |
lastUpdated: 1439478405547, | |
items: ['a-1'] | |
} | |
}, | |
entities: { | |
todoLists: { | |
'tl-1': { | |
id: 'tl-1', | |
title: 'First TodoList' | |
} | |
}, | |
todos: { | |
't-1': { | |
id: 't-1', | |
todoListId: 'tl-1', | |
summary: 'First Task' | |
}, | |
't-2': { | |
id: 't-2', | |
todoListId: 'tl-1', | |
summary: 'Second Task' | |
} | |
}, | |
attachments: { | |
'a-1': { | |
id: 'a-1', | |
url: 'http://example.come/file123.pdf?token=456' | |
} | |
} | |
} | |
}; |
This file contains hidden or 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
var exampleInline = { | |
selectedTodoList: 'tl-1', | |
entities: { | |
todoLists: { | |
'tl-1': { | |
id: 'tl-1', | |
title: 'First TodoList', | |
todos: { | |
lastUpdated: 1439478405547, | |
items: ['t-1', 't-2'] | |
} | |
} | |
}, | |
todos: { | |
't-1': { | |
id: 't-1', | |
todoListId: 'tl-1', | |
summary: 'First Task', | |
attachments: { | |
lastUpdated: 1439478405547, | |
items: ['a-1'] | |
} | |
}, | |
't-2': { | |
id: 't-2', | |
todoListId: 'tl-1', | |
summary: 'Second Task' | |
} | |
}, | |
attachments: { | |
'a-1': { | |
id: 'a-1', | |
url: 'http://example.come/file123.pdf?token=456' | |
} | |
} | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment