Skip to content

Instantly share code, notes, and snippets.

@nerdbeere
Last active October 13, 2016 15:40
Show Gist options
  • Select an option

  • Save nerdbeere/a56edc112823abac3d2b6981cca401b1 to your computer and use it in GitHub Desktop.

Select an option

Save nerdbeere/a56edc112823abac3d2b6981cca401b1 to your computer and use it in GitHub Desktop.
class UiAdapter {
constructor(coreApi, uiApi) {
coreApi.on('statechange', (state) => {
uiApi.setState(state);
});
uiApi.onAction('play', () => {
coreApi.transitionTo('play');
});
uiApi.onAction('pause', () => {
coreApi.transitionTo('pause');
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment