Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Empty model? #3

Closed
cjolif opened this Issue Jan 29, 2014 · 7 comments

Comments

Projects
None yet
3 participants

cjolif commented Jan 29, 2014

The model property documentation states:

 One can set this to an empty object if you don't want any methods to decorate the returned objects (this can improve performance by avoiding prototype setting)

but if I set it to {} I get the following error:

Error: Cannot set property '_store' of undefined
Collaborator

brandonpayton commented Jan 29, 2014

This line in Store.js appears to be the culprit. I'm not sure if it is outdated documentation or just a bug.

If a model is not desired, it seems like supporting model: null would be a clearer approach for dstore than accepting an object literal for a property that is normally a constructor.

cjolif commented Jan 30, 2014

I agree null would be clearer.

cjolif commented Jan 30, 2014

This line in Store.js appears to be the culprit. I'm not sure if it is outdated documentation or just a bug.

If I change this line to only set the store if the prototype is not undefined I indeed do have the behavior I expect with a {} model (that said I have no proof this is working in all cases).

cjolif commented Feb 18, 2014

Can I just know if that is a document or a code bug? So that I can adjust my use based on that? (not asking for a fix just for whether I should expect this to work one day or not). thanks.

Collaborator

brandonpayton commented Feb 18, 2014

I just spoke with @kriszyp, and it is a bug in the code. Kris will be fixing this to work with model: null.

Collaborator

kriszyp commented Feb 18, 2014

Yes, let's go with model: null. Fixed with 8bd63d5

@kriszyp kriszyp closed this Feb 18, 2014

cjolif commented Feb 18, 2014

thanks a lot guys, going to give it a try.

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