Created
September 21, 2022 16:38
-
-
Save IniZio/f8f2e50b9af4485e201fad5cb70d8d1a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const products = state([{name: 'ABC', authorID: 1}]); | |
const users = state([{ID: 1, name: 'Tom'}]); | |
const productWithUsers = computed(() => products.value.map(p => { | |
const user = users.find(u => u.ID === p.authorID); | |
return {...p, author: user}; | |
}))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment