Skip to content

Instantly share code, notes, and snippets.

@o0101
Created September 20, 2017 02:05
Show Gist options
  • Save o0101/4288fe23c0287e49e6cbac4d4ac27860 to your computer and use it in GitHub Desktop.
Save o0101/4288fe23c0287e49e6cbac4d4ac27860 to your computer and use it in GitHub Desktop.
/**
Example of component api idea
**/
component1.api = {
add_sel()
del_sel()
generalize()
};
component2.api = {
track_sel()
untrack_sel()
}
orchestrator = {
onMessage( m ) {
if ( m.type == 'add_sel' ) {
component2.send_message( { type : 'track_sel', sel: m.sel } );
}
}
}
// etc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment