github.com/akzi/consul@v1.4.5/ui-v2/app/services/store.js (about)

     1  import Store from 'ember-data/store';
     2  
     3  // TODO: These only exist for ACLs, should probably make sure they fail
     4  // nicely if you aren't on ACLs for good DX
     5  export default Store.extend({
     6    // cloning immediately refreshes the view
     7    clone: function(modelName, id) {
     8      // TODO: no normalization, type it properly for the moment
     9      const adapter = this.adapterFor(modelName);
    10      // passing empty options gives me a snapshot - ?
    11      const options = {};
    12      // _internalModel starts with _ but isn't marked as private ?
    13      return adapter.clone(
    14        this,
    15        { modelName: modelName },
    16        id,
    17        this._internalModelForId(modelName, id).createSnapshot(options)
    18      );
    19      // TODO: See https://github.com/emberjs/data/blob/7b8019818526a17ee72747bd3c0041354e58371a/addon/-private/system/promise-proxies.js#L68
    20    },
    21    self: function(modelName, token) {
    22      // TODO: no normalization, type it properly for the moment
    23      const adapter = this.adapterFor(modelName);
    24      return adapter.self(this, { modelName: modelName }, token);
    25    },
    26  });