Last active
July 4, 2017 08:08
-
-
Save rubystar/5d7f32c62891f56d3f50394cc377e238 to your computer and use it in GitHub Desktop.
redux state structure
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
//Widgets | |
{ | |
byId: { | |
1: { | |
settings:{name: 'report 1', description: 'report 1 desc'}, | |
child_widget_ids: [10, 11] | |
}, | |
2: { | |
settings:{name: 'report 2', description: 'report 2 desc'}, | |
child_widget_ids: [12, 13] | |
}, | |
11: { | |
foo: bar | |
}, | |
12: { | |
} // and so on... | |
} | |
allIds: [1, 2, 11, 12, ...] | |
} | |
// in order to get a report from store | |
currWid = store.get("widgets").get("byId")(1) | |
// chart instances for the selected report | |
currWid.get("child_widgets_ids").map((item) => store.get("widgets").byId("item")); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment