Last active
October 14, 2016 18:37
-
-
Save dabbott/3fb41d149f5c8cc0f39f9f1f6acbe163 to your computer and use it in GitHub Desktop.
Yops Redux API
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
// In Deco | |
const mapStateToProps = (state) => createSelector( | |
(state) => state.storyboard, | |
(storyboard) => ({ | |
storyboard, | |
}) | |
) | |
class Storyboard extends Component { | |
const {storyboard, dispatch, fileId} = this.props | |
render() { | |
<YOPS | |
// The currently running storyboard | |
storyboardId={fileId} | |
// State for all storyboards | |
state={storyboard} | |
// Allow Yops to fire actions | |
dispatch={dispatch} | |
/> | |
} | |
} |
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
// In Yops | |
// Owner applies this middleware to the redux store | |
export { syncServiceMiddleware } from './middlewares' | |
// Owner adds this reducer to the redux store via combineReducers | |
export storyboardReducer from './reducers' | |
// Owner calls these actions to update the storyboard state | |
// - we'll probably only expose a subset of the actions | |
// - there will be actions specifically for saying "this is the source of truth, | |
// update no matter what" | |
export storyboardActions from './actions' | |
// Owner renders this component, passing in storyboard state | |
export default from './containers/Root' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment