all files / couch/couch/changes/feed/unified/mixins/ with-since.js

100% Statements 10/10
75% Branches 3/4
100% Functions 3/3
100% Lines 10/10
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29              20× 20×       31× 31× 31×   31×       19× 19×          
import Ember from 'ember';
 
const {
  merge
} = Ember;
 
export default Superclass => class extends Superclass {
 
  constructor(opts, context) {
    super(opts, context);
    this.since = opts.since || undefined;
  }
 
  get qs() {
    let since = this.since;
    Eif(typeof since === 'undefined') {
      since = 'now';
    }
    return merge(super.qs, { since });
  }
 
  stop() {
    super.stop();
    return { since: this.since };
  }
 
}