Mirror: The highly customizable and versatile GraphQL client with which you add on features like normalized caching as you grow.
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

docs(svelte): first draft of clarifying subscription language for svelte (#3013)

authored by

Jeremy Bunting and committed by
GitHub
7191074b 64319ec2

+5 -4
+5 -4
docs/advanced/subscriptions.md
··· 200 200 <p>No new messages</p> 201 201 {:else} 202 202 <ul> 203 - {#each $messages.data as message} 203 + {#each $messages.data.newMessages as message} 204 204 <li>{message.from}: "{message.text}"</li> 205 205 {/each} 206 206 </ul> ··· 208 208 209 209 ``` 210 210 211 - As we can see, the `$messages.data` is being updated and transformed by the `handleSubscription` 212 - function. This works over time, so as new messages come in, we will append them to 211 + As we can see, `$messages.data` is being updated and transformed by the `$messages` subscriptionStore. This works over time, so as new messages come in, we will append them to 213 212 the list of previous messages. 214 213 215 - [Read more about the `subscription` API in the API docs for it.](../api/svelte.md#subscription) 214 + `subscriptionStore` optionally accepts a second argument, a handler function, allowing custom update behavior from the subscription. 215 + 216 + [Read more about the `subscription` API in the API docs for it.](../api/svelte.md#subscriptionstore) 216 217 217 218 ## Vue 218 219