Skip to content

Instantly share code, notes, and snippets.

@savelichalex
Created November 18, 2015 23:00
Show Gist options
  • Save savelichalex/8018df28102c9df3eba1 to your computer and use it in GitHub Desktop.
Save savelichalex/8018df28102c9df3eba1 to your computer and use it in GitHub Desktop.
Universal structure to allow communication between parent and child views
class Queue {
constructor( cb ) {
if( !cb ) {
throw new Error( 'You must specified callback');
}
this._cb = cb;
}
push( data ) {
this._cb( data )
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment