Skip to content

OnDisconnect Compat #4727

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions packages/database/exp/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ export {
Reference,
ListenOptions,
Unsubscribe,
ThenableReference,
OnDisconnect
ThenableReference
} from '../src/exp/Reference';
export { OnDisconnect } from '../src/exp/OnDisconnect';
export {
QueryConstraint,
DataSnapshot,
Expand Down Expand Up @@ -67,7 +67,11 @@ export {
refFromURL
} from '../src/exp/Reference_impl';
export { increment, serverTimestamp } from '../src/exp/ServerValue';
export { runTransaction, TransactionOptions } from '../src/exp/Transaction';
export {
runTransaction,
TransactionOptions,
TransactionResult
} from '../src/exp/Transaction';

declare module '@firebase/component' {
interface NameServiceMapping {
Expand Down
6 changes: 3 additions & 3 deletions packages/database/src/api/Database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@ export class Database implements FirebaseService, Compat<ExpDatabase> {
validateArgCount('database.ref', 0, 1, arguments.length);
if (path instanceof Reference) {
const childRef = refFromURL(this._delegate, path.toString());
return new Reference(this, childRef._path);
return new Reference(this, childRef);
} else {
const childRef = ref(this._delegate, path);
return new Reference(this, childRef._path);
return new Reference(this, childRef);
}
}

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

// Make individual repo go offline.
Expand Down
Loading