forked from invertase/react-native-firebase
-
Notifications
You must be signed in to change notification settings - Fork 0
/
type-test.ts
67 lines (51 loc) · 1.51 KB
/
type-test.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import firebase from '@react-native-firebase/app';
import * as database from '@react-native-firebase/database';
console.log(database.default().ref().parent);
// checks module exists at root
console.log(firebase.database().app.name);
console.log(firebase.database().ref('foo/bar'));
// checks module exists at app level
console.log(firebase.app().database().app.name);
// check module accepts a string arg
console.log(firebase.app().database('some-string').app.name);
// checks statics exist
console.log(firebase.database.SDK_VERSION);
// checks statics exist on defaultExport
console.log(database.firebase.SDK_VERSION);
// checks root exists
console.log(firebase.SDK_VERSION);
// checks firebase named export exists on module
console.log(database.firebase.SDK_VERSION);
// checks multi-app support exists
console.log(firebase.database(firebase.app()).app.name);
// checks default export supports app arg
console.log(database.default(firebase.app('foo')).app.name);
console.log(firebase.database.ServerValue.TIMESTAMP);
console.log(
firebase
.app()
.database()
.ref('foo/bar'),
);
firebase
.database()
.ref('foo')
.push({
foo: 'bar',
});
firebase
.database()
.goOnline()
.then();
const r = firebase.database().ref('foo');
r.child('foo')
.update({ foo: 'bar' }, () => {})
.then();
r.once('value').then(ds => {
console.log(ds.exists());
console.log(ds.forEach);
console.log(ds.val());
console.log(ds.hasChildren());
console.log(ds.hasChild('foo'));
console.log(ds.getPriority());
});