Skip to content

Instantly share code, notes, and snippets.

@IniZio
Created September 21, 2022 16:38
Show Gist options
  • Save IniZio/f8f2e50b9af4485e201fad5cb70d8d1a to your computer and use it in GitHub Desktop.
Save IniZio/f8f2e50b9af4485e201fad5cb70d8d1a to your computer and use it in GitHub Desktop.
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