all files / documents/database/operations/internal/ load.js

85.71% Statements 6/7
66.67% Branches 4/6
100% Functions 1/1
85.71% Lines 6/7
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                                       
import Ember from 'ember';
import BaseLoad from './-load';
 
const {
  merge
} = Ember;
 
export default class InternalDocumentLoadOperation extends BaseLoad {
 
  invoke() {
    let opts = merge({ force: false }, this.opts);
 
    Iif(this.state.isLoaded && !opts.force) {
      return this.resolve();
    }
 
    if(this.state.isNew) {
      return this.resolve();
    }
 
    return this._invoke();
  }
 
}