Last active
October 14, 2016 18:52
-
-
Save dabbott/8d287cd27e31b7699b34de83c81da7fa to your computer and use it in GitHub Desktop.
Yops Redux API 2
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 | |
class Storyboard extends Component { | |
const {storyboard, dispatch, fileId} = this.props | |
render() { | |
<YOPS | |
// The currently running storyboard | |
storyboardId={fileId} | |
/> | |
} | |
} |
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 | |
// Store is created as a singleton, shared between all instances of Yops | |
// - data is keyed by storyboard filePath | |
// - to read data, owner calls store.getState() | |
// - to fire actions, owner calls e.g. store.dispatch(storyboardActions.addScene()) | |
export storyboardStore from './store' | |
// 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 | |
export default from './containers/Root' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment