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
// This will break incremental compilation | |
def gitSha = 'git rev-parse --short HEAD'.execute([], project.rootDir).text.trim() | |
def buildTime = new Date().format("yyyy-MM-dd'T'HH:mm:ss'Z'", TimeZone.getTimeZone("UTC")) | |
android { | |
defaultConfig { | |
buildConfigField "String", "GIT_SHA", "\"${gitSha}\"" | |
buildConfigField "String", "BUILD_TIME", "\"${buildTime}\"" | |
} |
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 ReducerFeatureWithoutNews : ReducerFeature<Wish, State, Nothing>( | |
initialState = State(), | |
reducer = ReducerImpl() | |
) { | |
data class State( | |
val counter: Int = 0 | |
) | |
sealed class Wish { | |
object IncreaseCounter : Wish() |
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
package io.reactivex; | |
import io.reactivex.annotations.*; | |
/** | |
* Represents a basic, non-backpressured {@link Observable} source base interface, | |
* consumable via an {@link Observer}. | |
* | |
* @param <T> the element type | |
* @since 2.0 |
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
package io.reactivex.functions; | |
/** | |
* A functional interface (callback) that accepts a single value. | |
* @param <T> the value type | |
*/ | |
public interface Consumer<T> { | |
/** | |
* Consume the given value. | |
* @param t the value |
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
val output: ObservableSource<String> = Observable.just("item1", "item2", "item3") | |
val input: Consumer<String> = Consumer { System.out.println(it) } | |
val disposable = Observable.wrap(output).subscribe(input) |
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
// Wishes -> Feature | |
val wishes: ObservableSource<Wish> = Observable.just(Wish.SomeWish) | |
val feature: Consumer<Wish> = SomeFeature() | |
val disposable = Observable.wrap(wishes).subscribe(feature) | |
// Feature -> State consumer | |
val feature: ObservableSource<State> = SomeFeature() | |
val logger: Consumer<State> = Consumer { System.out.println(it) } | |
val disposable = Observable.wrap(feature).subscribe(logger) |
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
val binder = Binder() | |
binder.bind(wishes to feature) | |
binder.bind(feature to logger) |
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
val output: ObservableSource<A> = TODO() | |
val input: Consumer<B> = TODO() | |
val transformer: (A) -> B = TODO() | |
binder.bind(output to input using transformer) |
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
val binder = Binder() | |
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
val binder = Binder(lifecycle) | |
OlderNewer