Created
November 18, 2015 23:00
-
-
Save savelichalex/8018df28102c9df3eba1 to your computer and use it in GitHub Desktop.
Universal structure to allow communication between parent and child views
This file contains 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
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