Created
June 22, 2015 23:43
-
-
Save omarstreak/8f9590514f326940e710 to your computer and use it in GitHub Desktop.
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
sdk.Lists.registerThreadRowViewHandler(function(threadRowView){ | |
var emitter; //variable name to hoist the emitter to | |
var stream = Kefir.stream(function(inEmitter){ | |
emitter = inEmitter; | |
return function(){}; //we need to return a function that gets called when the stream ends | |
}); | |
threadRowView.addLabel(stream); //add the label passing in the stream | |
emitter.emit({labelOptions}); //to update the label you call .emit on the emitter with the new label options | |
someOtherAppThing.addListener(function(){ | |
emitter.emit(null); //to remove the label you pass null into the stream | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment