xaviergonz / mobx-keystone

A MobX powered state management solution based on data trees with first class support for Typescript, support for snapshots, patches and much more
https://mobx-keystone.js.org
MIT License
549 stars 25 forks source link

Should BaseModel::getRefId return this.$modelId by default? #53

Closed sisp closed 5 years ago

sisp commented 5 years ago

Since #50 and #51, does it make sense to let BaseModel::getRefId return this.$modelId by default?

xaviergonz commented 5 years ago

I guess it does :)

xaviergonz commented 5 years ago

Done in https://github.com/xaviergonz/mobx-keystone/pull/54

Maaartinus commented 5 years ago

The next question is when it makes sense to return anything else. ATM I can't see any reason how having two IDs could be better (but I'm rather a noob in this area and my imagination is limited).

xaviergonz commented 5 years ago

I guess in case your snapshot includes another kind of ID coming from backend for example and you want to use that one