-
Notifications
You must be signed in to change notification settings - Fork 62
Collection items is not unique #80
Comments
You should make it dynamic, a function (it's evaluated only once now and set as the value). |
@webpro thank you, now it's unique: template: {
random: ()=> Math.random(),
} [{"random":0.44458511570855785},{"random":0.9926197994943111}] But can I make all items in template to be unique? Like this: template: () => {
return {
random: Math.random(),
}
} I tried to do this, but it not makes items values unique. |
Are you saying that with the second example, you get the same value for |
Yes. |
But it's a fixed value, not a function anymore, as I've explained above. It evaluates the template, and if |
Okay I got it. For me, it was unexpected that |
The difference between |
I trying to create a collection, and items data is not unique.
Here is a quick example on how to reproduce this:
/services/get/collection.js
package.json
Run
services
:And got this:
Items is not unique as you can see. All the same.
Something is missing in my code?
The text was updated successfully, but these errors were encountered: