firebase-event-stream
v2.0.2
Published
Readable stream that listen to firebase events and stream children
Downloads
3
Readme
firebase-event-stream
import Firebase from 'firebase'
import eventStream from 'firebase-event-stream'
const ref = new Firebase('https://some.firebaseio.com/')
const events = ['child_added']
const stream = eventStream(ref, { events })
.on('data', ({ event, child }) => console.log('emitted ', event, child.val()))
ref.push({ foo: 1 })
ref.push({ foo: 2 })
// log emitted child_added { foo: 1 }
// log emitted child_added { foo: 2 }