File tree Expand file tree Collapse file tree 3 files changed +5
-34
lines changed Expand file tree Collapse file tree 3 files changed +5
-34
lines changed Original file line number Diff line number Diff line change 16
16
*/
17
17
18
18
import { registerVersion , _registerComponent } from '@firebase/app-exp' ;
19
- import {
20
- Firestore ,
21
- initializeFirestore ,
22
- getFirestore
23
- } from './src/api/database' ;
19
+ import { Firestore } from './src/api/database' ;
24
20
import { version } from '../package.json' ;
25
21
import { Component , ComponentType } from '@firebase/component' ;
26
22
27
- import { makeConstructorPrivate } from '../src/util/api' ;
28
-
29
- export const PublicFirestore = makeConstructorPrivate (
23
+ export {
30
24
Firestore ,
31
- 'Use getFirestore() instead.'
32
- ) ;
33
-
34
- const firestoreNamespace = {
35
- Firestore : PublicFirestore ,
36
25
initializeFirestore ,
37
26
getFirestore
38
- } ;
27
+ } from './src/api/database' ;
39
28
40
29
export function registerFirestore ( ) : void {
41
30
_registerComponent (
@@ -49,7 +38,7 @@ export function registerFirestore(): void {
49
38
) ;
50
39
} ,
51
40
ComponentType . PUBLIC
52
- ) . setServiceProps ( { ... firestoreNamespace } )
41
+ )
53
42
) ;
54
43
registerVersion ( 'firestore-lite' , version , 'node' ) ;
55
44
}
Original file line number Diff line number Diff line change @@ -96,10 +96,5 @@ export function initializeFirestore(
96
96
}
97
97
98
98
export function getFirestore ( app : FirebaseApp ) : Firestore {
99
- const firestore = _getProvider (
100
- app ,
101
- 'firestore/lite'
102
- ) . getImmediate ( ) as Firestore ;
103
- firestore . _ensureClientConfigured ( ) ;
104
- return firestore ;
99
+ return _getProvider ( app , 'firestore/lite' ) . getImmediate ( ) as Firestore ;
105
100
}
Original file line number Diff line number Diff line change @@ -38,17 +38,4 @@ describe('Firestore', () => {
38
38
const fs2 = getFirestore ( app ) ;
39
39
expect ( fs1 === fs2 ) . to . be . true ;
40
40
} ) ;
41
-
42
- it ( 'cannot call initializeFirestore() after getFirestore()' , ( ) => {
43
- const app = initializeApp (
44
- { apiKey : 'fake-api-key' , projectId : 'test-project' } ,
45
- 'test-app-getFirestore-initializeFirestore'
46
- ) ;
47
- getFirestore ( app ) ;
48
- expect ( ( ) => initializeFirestore ( app , { } ) ) . to . throw (
49
- 'Firestore has already been started and its settings can no longer ' +
50
- 'be changed. initializeFirestore() cannot be called after calling ' +
51
- 'getFirestore().'
52
- ) ;
53
- } ) ;
54
41
} ) ;
You can’t perform that action at this time.
0 commit comments