RxFBase
wrapping firebase with rx
In the past, I have a problem when doing real-time marker mapping (maps) using firebase. So, I tried to create this library for my case. enjoy!
TODO:
- firebase database
- firebase auth
- firebase storage
Installation
Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven {
url 'https://jitpack.io'
}
}
}
Add the dependency
compile 'com.github.isfaaghyth:RxFBase:1.0.0'
Usage
set value:
HashMap<String, String> data = new HashMap<>();
data.put("title", "this is title");
data.put("message", "awesome message!");
RxFirebase.setValue(dbRef, data)
.subscribe(isSuccess -> {
//isSuccess true/false
}
);
for singleValue:
RxFirebase.singleValue(dbRef)
.subscribe(dataSnapshot -> {
//do something!
}
, throwable -> {
//ops!
}
);
for childValue:
RxFirebase.childValue(dbRef)
.subscribe(dataSnapshot -> {
//do something!
}
, throwable -> {
//ops!
}
);
enjoy!
MIT