aurelia-firebase icon indicating copy to clipboard operation
aurelia-firebase copied to clipboard

remove dependencies for ReactiveCollection

Open tonypee opened this issue 9 years ago • 1 comments

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 avatar Jul 05 '16 15:07 tonypee

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);
  }

tonypee avatar Jul 05 '16 15:07 tonypee