All Projects → yongjhih → RxBolts

yongjhih / RxBolts

Licence: Apache-2.0 license
Reactive Bolts-Android Framework

Programming Languages

java
68154 projects - #9 most used programming language
prolog
421 projects

RxBolts

Android Arsenal JitPack Download javadoc Build Status ![Methods Count](https://img.shields.io/badge/Methods and size-core: 54 | deps: 4111 | 6 KB-e91e63.svg) Gitter Chat Coverage Status Codacy Badge

Reactive Bolts-Android. Allow convert Task<T> to Observable<T>.

Usage

TaskObservable.defer():

TaskObservable.defer(() -> Task.forResult("Hello, world!")).subscribe(it -> {
  System.out.println(it);
});

Take 5 users using Parse:

TaskObservable.defer(() -> ParseUser.getQuery().findInBackground()).flatMap(Observable::from).take(5).subscribe(user -> {
  System.out.println(user.getObjserId());
});

Update location of 5 users using Parse:

TaskObservable.defer(() -> ParseUser.getQuery().findInBackground()).flatMap(Observable::from).take(5).flatMap(user -> {
  user.put("location", "Taipei");
  return TaskObservable.defer(() -> user.saveInBackground());
}).subscribe();

Error handling

Failed:

TaskObservable.defer(() -> Task.forError(new RuntimeException("An error message."))).subscribe(it -> {}, e -> {
  e.printStackTrace(); // RuntimeException
});

AppLinks

javadoc

AppLinkObservable.navigate(context, url, resolver);
AppLinkNavigation.setDefaultResolver(resolver);
AppLinkObservable.navigate(context, url);

Sample code

Installation

For RxJava2

Via jitpack.io

repositories {
    jcenter()
    maven { url "https://jitpack.io" }
}

dependencies {
    compile 'com.github.yongjhih.RxBolts:rxbolts2:-SNAPSHOT'
    //compile 'com.github.yongjhih.RxBolts:rxbolts2-taks:-SNAPSHOT'
    //compile 'com.github.yongjhih.RxBolts:rxbolts2-applinks:-SNAPSHOT'
}

For RxJava1

via jcenter

repositories {
    jcenter()

}

dependencies {
    compile 'com.infstory:rxbolts:1.0.1'
}

Or via jitpack.io

repositories {
    jcenter()
    maven { url "https://jitpack.io" }
}

dependencies {
    compile 'com.github.yongjhih.RxBolts:rxbolts:-SNAPSHOT'
    //compile 'com.github.yongjhih.RxBolts:rxbolts-tasks:-SNAPSHOT'
    //compile 'com.github.yongjhih.RxBolts:rxbolts-applinks:-SNAPSHOT'
}

Development and deploy to jcenter

rxbolts:

./gradlew :rxbolts:build :rxbolts:bintrayUpload

See Also

ref.

LICENSE

Copyright 2015 8tory, Inc.

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].