[internals][types] Fix a couple of minor issues

This commit is contained in:
Chris Bianca
2018-01-05 18:23:38 +00:00
parent 80cb54ee6d
commit d1f2b3fcfa
9 changed files with 32 additions and 27 deletions

View File

@@ -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);
}
}