moved the DS.RecordArray creation of Store#all(type) into a separate function #464

Closed
wants to merge 2 commits into
from

Conversation

Projects
None yet
3 participants

dagda1 commented Nov 7, 2012

Previously Store#all had the creation of the returned DS.RecordArray hard coded into the function:

var array = DS.RecordArray.create({ type: type, content: Ember.A([]), store: this, isLoaded: true });
this.registerRecordArray(array, type);

This pull request gives the user an opportunity to supply a derived type:

    //Store#all
    var array = this.newRecordArray(type);

    this.registerRecordArray(array, type);
  newRecordArray: function(type){
    return DS.RecordArray.create({ type: type, content: Ember.A([]), store: this, isLoaded: true });
  },

For example, I might want to supply a PagedRecordArray that provides paging functionality.

Owner

tomdale commented Nov 20, 2012

I think this would more idiomatically be named createRecordArray instead of newRecordArray.

dagda1 added some commits Nov 7, 2012

moved the DS.RecordArray creation of Store#all(type) into a separate
function to allow the user to override and supply a derived
DS.RecordArray type.
Owner

igorT commented Apr 8, 2013

Seems good, but could you elaborate on what the use case for this is?

dagda1 commented Apr 8, 2013

It is an old PR and I do not think it is relevant anymore.

@dagda1 dagda1 closed this Apr 8, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment