Skip to content

Commit 3b8900b

Browse files
authored
docs: subscribeToMore / updateQuery (#1407)
1 parent fc98307 commit 3b8900b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/docs/src/guide-composable/subscription.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -545,8 +545,9 @@ subscribeToMore(() => ({
545545
channelId: props.channelId
546546
},
547547
updateQuery: (previousResult, { subscriptionData }) => {
548-
previousResult.messages.push(subscriptionData.data.messageAdded)
549-
return previousResult
548+
const tmp = [...previousResult]
549+
tmp.messages.push(subscriptionData.data.messageAdded)
550+
return tmp
550551
}
551552
}))
552553
```

0 commit comments

Comments
 (0)