Created
June 26, 2016 05:37
-
-
Save kaushikgopal/683d9fd1b307ff4ce4500e721188bafc to your computer and use it in GitHub Desktop.
Blog post snippet for implementing event bus
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
// note that it is important to subscribe to the exact same _rxBus instance that was used to post the events | |
_rxBus.toObserverable() | |
.subscribe(new Action1<Object>() { | |
@Override | |
public void call(Object event) { | |
if(event instanceof TapEvent) { | |
_showTapText(); | |
}else if(event instanceof SomeOtherEvent) { | |
_doSomethingElse(); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment