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
The problem is when you create an item on the front-end, you want to show that item as soon as practical. Immediately is optimal. But to do that, you need to assign a temporary ID until the backend responds with the actual one.
Currently, by updating an iD, you are signalling to vue that the original object has been removed, and a new one with this other ID has been added. This triggers an in and out animation that isn't desired in my case.
What does the proposed API look like?
I imagine it'd be similar to $set, but with some form of explicit mention of "calm down, I'm not changing which object this is".
You could probably use $set with an extra argument, such as:
$set(item,"ID",1234,true)
Alternatively, a brand new function could be appropriate.
$setInPlace(item,"ID",1234)
Or instead of giving an item the ID directly, perhaps a wrapper would be more appropriate:
letnewItem={ID: TemporaryID()}// ... later ...item.ID(realID)
The text was updated successfully, but these errors were encountered:
What problem does this feature solve?
The issue is described here: https://stackoverflow.com/questions/55292425/can-you-change-an-items-id-in-vue-js
The problem is when you create an item on the front-end, you want to show that item as soon as practical. Immediately is optimal. But to do that, you need to assign a temporary ID until the backend responds with the actual one.
Currently, by updating an iD, you are signalling to vue that the original object has been removed, and a new one with this other ID has been added. This triggers an in and out animation that isn't desired in my case.
What does the proposed API look like?
I imagine it'd be similar to $set, but with some form of explicit mention of "calm down, I'm not changing which object this is".
You could probably use $set with an extra argument, such as:
Alternatively, a brand new function could be appropriate.
Or instead of giving an item the ID directly, perhaps a wrapper would be more appropriate:
The text was updated successfully, but these errors were encountered: