You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you call new Todo(), a temp record is created. The temp record contains a temporary `__id` (note the double underscore) and a `__isTemp` attribute. (These attributes can be discarded in a before hook so they don’t get sent to the server.)
To assist in Vue reactivity, this temp record is updated with the API response. The record will keep the local `__id` for building components that recognize the change from temp to permanent record. Records will no longer have the `__isTemp` attribute.
To keep this from being a breaking change, a few new mutation were created. They can be found in the `addOrUpdate` service action:
- `remove__isTemp` does just what it says.
- `replaceItemWithTemp` Adds or updates an item. If a matching temp record is found in the store, the temp record will completely replace the existingItem. This is to work around the common scenario where the realtime `created` event arrives before the `create` response returns to create the record. The reference to the original temporary record must be maintained in order to preserve reactivity.
0 commit comments