PulsarBlow / aurelia-firebase

🔥 A Firebase plugin for Aurelia
https://aureliaonfire.azurewebsites.net
MIT License
23 stars 6 forks source link

remove dependencies for ReactiveCollection #9

Open tonypee opened 8 years ago

tonypee commented 8 years ago

I just wanted to quickly integrate the ReactiveCollection in my app, so i thought that it would work well if it just took a ref() therefore, it doesnt need any other dependencies:

https://gist.github.com/tonypee/c2dcf22a1f3075e388fc0a7454a88ef6

Maybe this would be a good feature

tonypee commented 8 years ago

scratch that, 1 dependancy (firebase) is definitely best.

import firebase from 'firebase'

export class ReactiveCollection {

  _ref = null;
  _valueMap = new Map();
  items = [];

  constructor(path) {
    this._ref = firebase.database().ref(path)
    this._listenToQuery(this._ref);
  }