Skip to content

Instantly share code, notes, and snippets.

@fab1an
Last active April 8, 2016 13:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fab1an/0e48f25f0f0e01215fb2c3ff6e5d7617 to your computer and use it in GitHub Desktop.
Save fab1an/0e48f25f0f0e01215fb2c3ff6e5d7617 to your computer and use it in GitHub Desktop.
/* App.makeProps */
static makeProps($) {
return {
/* call Box.makeProps to construct the substate */
box1: [Box, "1"],
box2: [Box, "2"],
/* call OtherData.makeProps to get the substate */
OtherData
}
}
/* Box.makeProps */
static makeProps($, dispatch, id) {
return {
top: $["box" + id].top || 0,
left: $["box" + id].left || 0,
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment