IDs in a front end application #55
-
Hi, got another question! Is it still the best option to use this ID and just update it in the front end when it changes, or is there another smoother way? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Unfortunately, Live doesn't offer a stable ID for its objects, but maybe you can use another value to uniquely identify them and keep a map of custom_id -> object which allows you to reference it. This is how I do it in AbleSet with locators, for example. Each locator has a unique position that I can use as its key to reference it in the web app and to store some additional metadata on the server-side. Of course, when the position of a marker changes, the code has to make sure that the reference stays the same even though its key changed. If you don't want to invest the time to write this, just using the |
Beta Was this translation helpful? Give feedback.
Unfortunately, Live doesn't offer a stable ID for its objects, but maybe you can use another value to uniquely identify them and keep a map of custom_id -> object which allows you to reference it.
This is how I do it in AbleSet with locators, for example. Each locator has a unique position that I can use as its key to reference it in the web app and to store some additional metadata on the server-side. Of course, when the position of a marker changes, the code has to make sure that the reference stays the same even though its key changed.
If you don't want to invest the time to write this, just using the
raw.id
property should work as well. Even if the ID of the object changes, you can st…