Skip to content

Commit

Permalink
typo
Browse files Browse the repository at this point in the history
  • Loading branch information
barbuza committed Feb 8, 2016
1 parent 2e1861f commit 7218520
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 4 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "kebakaran",
"version": "0.1.8",
"version": "0.1.9",
"description": "high level utilities for firebase interaction",
"main": "index.js",
"scripts": {
Expand Down Expand Up @@ -37,6 +37,7 @@
"eslint-config-airbnb": "^5.0.0",
"eslint-plugin-react": "^3.16.1",
"faucet": "0.0.1",
"firebase": "^2.4.0",
"raf": "^3.1.0",
"tape": "^4.4.0"
},
Expand Down
4 changes: 1 addition & 3 deletions src/FirebaseList.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ export default class FirebaseList extends EventEmitter {
item.on('value', value => {
this.onValue(key, value);
});

this.flush();
}

onChildRemoved(c) {
Expand Down Expand Up @@ -81,7 +79,7 @@ export default class FirebaseList extends EventEmitter {

flush() {
if (this.hasData()) {
this.emit('vaue', this.data);
this.emit('value', this.data);
}
}

Expand Down
38 changes: 38 additions & 0 deletions tests/Firebase-tape.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import test from 'tape';
import Firebase from 'firebase';

import { FirebaseList } from '../src';

test.skip('Firebase', t => {
t.plan(2);

const list = new FirebaseList(new Firebase('https://kebakaran-test.firebaseio.com/list'), key => ({
name: new Firebase(`https://kebakaran-test.firebaseio.com/names/${key}`),
count: new Firebase(`https://kebakaran-test.firebaseio.com/counts/${key}`),
}));

let step = 1;

list.on('value', value => {
if (step === 1) {
t.deepEqual(value, []);
step = 2;
} else {
t.deepEqual(value, [
{
id: '1',
name: 'foo',
count: 10,
},
{
id: '2',
name: 'bar',
count: 20,
},
]);

list.close();
t.end();
}
});
});

0 comments on commit 7218520

Please sign in to comment.