mirror of
https://github.com/status-im/react-native-firebase.git
synced 2026-08-31 14:11:12 +00:00
[both][database] all 'once' event types now supported - not just 'value'
This commit is contained in:
@@ -299,7 +299,12 @@ public class RNFirebaseDatabase extends ReactContextBaseJavaModule {
|
||||
@ReactMethod
|
||||
public void once(final int refId, final String path, final ReadableArray modifiers, final String eventName, final Callback callback) {
|
||||
RNFirebaseDatabaseReference ref = this.getDBHandle(refId, path, modifiers);
|
||||
ref.addOnceValueEventListener(callback);
|
||||
|
||||
if (eventName.equals("value")) {
|
||||
ref.addOnceValueEventListener(callback);
|
||||
} else {
|
||||
ref.addChildOnceEventListener(eventName, callback);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user