File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
app/src/main/java/durdinapps/rxfirebase2 Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ public void cancel() throws Exception {
82
82
*
83
83
* @param query reference represents a particular location in your Database and can be used for reading or writing data to that Database location.
84
84
* @return a {@link Maybe} which emits the actual state of the database for the given query. onSuccess will be only call when
85
- * the given {@link DataSnapshot} exists.
85
+ * the given {@link DataSnapshot} exists onComplete will only called when the data doesn't exist .
86
86
*/
87
87
@ NonNull
88
88
public static Maybe <DataSnapshot > observeSingleValueEvent (@ NonNull final Query query ) {
@@ -95,7 +95,9 @@ public void onDataChange(DataSnapshot dataSnapshot) {
95
95
if (dataSnapshot .exists ()) {
96
96
emitter .onSuccess (dataSnapshot );
97
97
}
98
- emitter .onComplete ();
98
+ else {
99
+ emitter .onComplete ();
100
+ }
99
101
}
100
102
101
103
@ Override
You can’t perform that action at this time.
0 commit comments