artesa / feathers-pinia

Connect your Feathers API to the most elegant data store for Vue
0 stars 0 forks source link

Changes compared to ‘feathers-pinia‘ #1

Open fratzinger opened 1 year ago

fratzinger commented 1 year ago

Setup Store

BaseModel:

clientAlias / models / registerClient

Chore

marshallswain commented 1 year ago

I think these are good calls. We might want to keep using defineProperty for __isClone to make it non-iterable (so it won't be sent to the API). Alternatively we keep showing people how to remove the attribute in a before-all hook on the client.

marshallswain commented 1 year ago

Not calling instanceDefaults by default, use this.init(data) instead

This is the exact direction I wanted to take the constructor. :+1:

fratzinger commented 1 year ago

Thanks for reviewing and your comments! And thanks for your open mind on these changes! Highly appreciated.

We might want to keep using defineProperty for __isClone to make it non-iterable (so it won't be sent to the API).

Good point! I forgot that defineProperty is enumerable: false by default. Because it was explicitly in feathers-vuex. As of now, I filter it through cleanData see source

I'll change it to defineProperty. That makes so much sense. Also for serialization. But the point stays, I think: don't set __isClone conditionally in the constructor depending on the options but make it false by default.

marshallswain commented 1 year ago

As of now, I filter it through cleanData

Yes, this is how I was doing it until a few months ago. I appreciate not having the extra setup step if we can avoid it.

Also for serialization. But the point stays, I think: don't set __isClone conditionally in the constructor depending on the options but make it false by default.

Good plan