Skip to content

Commit f51cc6e

Browse files
Compat class for Reference (#4719)
1 parent cae7ea5 commit f51cc6e

File tree

9 files changed

+311
-269
lines changed

9 files changed

+311
-269
lines changed

packages/database/exp/index.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,11 @@ export {
6767
refFromURL
6868
} from '../src/exp/Reference_impl';
6969
export { increment, serverTimestamp } from '../src/exp/ServerValue';
70-
export { runTransaction, TransactionOptions } from '../src/exp/Transaction';
70+
export {
71+
runTransaction,
72+
TransactionOptions,
73+
TransactionResult
74+
} from '../src/exp/Transaction';
7175

7276
declare module '@firebase/component' {
7377
interface NameServiceMapping {

packages/database/src/api/Database.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,10 @@ export class Database implements FirebaseService, Compat<ExpDatabase> {
8484
validateArgCount('database.ref', 0, 1, arguments.length);
8585
if (path instanceof Reference) {
8686
const childRef = refFromURL(this._delegate, path.toString());
87-
return new Reference(this, childRef._path);
87+
return new Reference(this, childRef);
8888
} else {
8989
const childRef = ref(this._delegate, path);
90-
return new Reference(this, childRef._path);
90+
return new Reference(this, childRef);
9191
}
9292
}
9393

@@ -101,7 +101,7 @@ export class Database implements FirebaseService, Compat<ExpDatabase> {
101101
const apiName = 'database.refFromURL';
102102
validateArgCount(apiName, 1, 1, arguments.length);
103103
const childRef = refFromURL(this._delegate, url);
104-
return new Reference(this, childRef._path);
104+
return new Reference(this, childRef);
105105
}
106106

107107
// Make individual repo go offline.

0 commit comments

Comments
 (0)