firebase-event-stream

2.0.2 • Public • Published

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 }
 

Readme

Keywords

Package Sidebar

Install

npm i firebase-event-stream

Weekly Downloads

6

Version

2.0.2

License

ISC

Last publish

Collaborators

  • pgherveou2