Skip to content

Instantly share code, notes, and snippets.

@rt2zz
Created July 30, 2015 23:06
Show Gist options
  • Save rt2zz/08c8799f848b3fa02457 to your computer and use it in GitHub Desktop.
Save rt2zz/08c8799f848b3fa02457 to your computer and use it in GitHub Desktop.
<ReduxProvider>
<ActionNode>
<ReduxConnector>
<ActionNodeConnector />
</ReduxConnector>
</ActionNode>
</ReduxProvider>
ReduxProvider = createReduxProvider(store)
ActionNode = createActionNode(actions)
ReduxConnector = createReduxConnector(SomeComponent)
ActionNodeConnector = createActionNodeConnector(SomeScene)
SomeScene will now have all actions (bound) from its parent node(s) available at props.nodeActions
It will throw an error if there is no ActionNode to grab from
Or there could be a similar select function which only grabs a subset of actions and maps them flattly onto props.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment