Skip to content

Commit

Permalink
Merge pull request #3 from Yarikx/reductor-rx-rename
Browse files Browse the repository at this point in the history
Rename reductor-rx project to reductor-rxjava
  • Loading branch information
Yarikx committed Oct 10, 2016
2 parents 892ae23 + 80e7f7f commit 930eaeb
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 26 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ buildscript {
project.ext {
bintrayUser = project.hasProperty('BINTRAY_USER') ? project.property('BINTRAY_USER') : ""
bintrayKey = project.hasProperty('BINTRAY_KEY') ? project.property('BINTRAY_KEY') : ""
reductorVersion = '0.9.0'
reductorVersion = '0.9.1'
}


Expand Down
2 changes: 1 addition & 1 deletion rx-store/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ apply from: '../gradle/publishing.gradle'
dependencies {
retrolambdaConfig 'net.orfjackal.retrolambda:retrolambda:2.3.0'
compile project(':lib')
compile 'io.reactivex:rxjava:1.1.9'
compile 'io.reactivex:rxjava:1.2.1'
}
20 changes: 2 additions & 18 deletions rx-store/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,18 +1,2 @@
#
# Copyright 2016 Yaroslav Heriatovych.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

ARTIFACT_ID=reductor-rx
POM_NAME=ReductorRx
ARTIFACT_ID=reductor-rxjava
POM_NAME=ReductorRxJava
12 changes: 6 additions & 6 deletions rx-store/src/main/java/com/yheriatovych/reductor/rx/RxStore.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import com.yheriatovych.reductor.Cancelable;
import com.yheriatovych.reductor.Store;
import rx.AsyncEmitter;
import rx.Emitter;
import rx.Observable;

public final class RxStore {
Expand All @@ -13,10 +13,10 @@ public final class RxStore {
* Note: This method will emit current sate immediately after subscribe
*/
public static <State> Observable<State> asObservable(final Store<State> store) {
return Observable.fromAsync(stateAsyncEmitter -> {
stateAsyncEmitter.onNext(store.getState());
final Cancelable cancelable = store.subscribe(stateAsyncEmitter::onNext);
stateAsyncEmitter.setCancellation(cancelable::cancel);
}, AsyncEmitter.BackpressureMode.LATEST);
return Observable.fromEmitter(emitter -> {
emitter.onNext(store.getState());
final Cancelable cancelable = store.subscribe(emitter::onNext);
emitter.setCancellation(cancelable::cancel);
}, Emitter.BackpressureMode.LATEST);
}
}

0 comments on commit 930eaeb

Please sign in to comment.