Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save omarstreak/8f9590514f326940e710 to your computer and use it in GitHub Desktop.
Save omarstreak/8f9590514f326940e710 to your computer and use it in GitHub Desktop.
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