We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a6cf692 commit b49737fCopy full SHA for b49737f
src.js
@@ -29,7 +29,7 @@ var list = {
29
},
30
31
transform (snapshotVal) {
32
- return toArray$(snapshotVal);
+ return snapshotVal === null ? null : toArray$(snapshotVal);
33
34
35
toString () {
tests.js
@@ -43,6 +43,35 @@ describe('ref', () => {
43
});
44
45
46
+ describe('getValue', () => {
47
+ it('handles null values', (done) => {
48
+ var schema = Schema.create(Firebase, HOST, (child) => {
49
+ child('test', string);
50
+ });
51
+ var ref = schema.createRef('test');
52
+ ref.getValue((err, val) => {
53
+ expect(val).toEqual(null);
54
+ done();
55
56
57
+
58
+ it.only('handles null values for lists', (done) => {
59
60
+ child('test', list, (child) => {
61
+ child(':id', string, (child) => {
62
+ child('blergh', string);
63
64
65
66
67
68
69
70
71
72
73
74
75
describe('listen', () => {
76
it('listens', (done) => {
77
var schema = Schema.create(Firebase, HOST, (child) => {
0 commit comments