Created
June 8, 2016 05:27
-
-
Save mindwing/59233b5b837d2111345e575e73aac408 to your computer and use it in GitHub Desktop.
Agera Explained - 08.Incrementally Agerifying legacy code
This file contains hidden or 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
Result<ResponseBlob> noResponse = Result.absent(); | |
Function<Throwable, Result<ResponseBlob>> withNoResponse = | |
Functions.staticFunction(noResponse); | |
Repository<Result<ResponseBlob>> responseRepository = | |
Repositories.repositoryWithInitialValue(noResponse) | |
.observe(requestVariable) | |
.onUpdatesPerLoop() | |
// .getFrom(requestVariable) if it does not supply Result, OR: | |
.attemptGetFrom(requestVariable).orEnd(withNoResponse) | |
.goTo(networkingExecutor) | |
.thenTransform(networkCallingFunction) | |
.compile(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment