mirror of
https://github.com/zhigang1992/react-native-firebase.git
synced 2026-05-07 18:37:42 +08:00
[internals][types] Fix a couple of minor issues
This commit is contained in:
@@ -2,7 +2,8 @@
|
||||
* @flow
|
||||
* Disconnect representation wrapper
|
||||
*/
|
||||
import { typeOf } from './../../utils';
|
||||
import { typeOf } from '../../utils';
|
||||
import { getNativeModule } from '../../utils/native';
|
||||
import type Database from './';
|
||||
import type Reference from './reference';
|
||||
|
||||
@@ -32,7 +33,7 @@ export default class Disconnect {
|
||||
* @returns {*}
|
||||
*/
|
||||
set(value: string | Object): Promise<void> {
|
||||
return this._database._native.onDisconnectSet(this.path, { type: typeOf(value), value });
|
||||
return getNativeModule(this._database).onDisconnectSet(this.path, { type: typeOf(value), value });
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -41,7 +42,7 @@ export default class Disconnect {
|
||||
* @returns {*}
|
||||
*/
|
||||
update(values: Object): Promise<void> {
|
||||
return this._database._native.onDisconnectUpdate(this.path, values);
|
||||
return getNativeModule(this._database).onDisconnectUpdate(this.path, values);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -49,7 +50,7 @@ export default class Disconnect {
|
||||
* @returns {*}
|
||||
*/
|
||||
remove(): Promise<void> {
|
||||
return this._database._native.onDisconnectRemove(this.path);
|
||||
return getNativeModule(this._database).onDisconnectRemove(this.path);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -57,6 +58,6 @@ export default class Disconnect {
|
||||
* @returns {*}
|
||||
*/
|
||||
cancel(): Promise<void> {
|
||||
return this._database._native.onDisconnectCancel(this.path);
|
||||
return getNativeModule(this._database).onDisconnectCancel(this.path);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user