Skip to content

Commit 4b53cca

Browse files
pavelglacfacebook-github-bot
authored andcommitted
doc(useSubscription): config argument should be memoized (#5033)
Summary: Do not rely solely on the example. The documentation should explicitly state that the config argument must be memorized. Pull Request resolved: #5033 Reviewed By: evanyeung Differential Revision: D79457303 Pulled By: captbaritone fbshipit-source-id: 790530e4f09b10a30052f78547e7a233eb4d06e7
1 parent 41766f5 commit 4b53cca

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

website/docs/api-reference/hooks/use-subscription.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function UserComponent({ id }) {
4141

4242
### Arguments
4343

44-
* `config`: a config of type [`GraphQLSubscriptionConfig`](#type-graphqlsubscriptionconfigtsubscriptionpayload) passed to [`requestSubscription`](../request-subscription/)
44+
* `config`: a memoized config of type [`GraphQLSubscriptionConfig`](#type-graphqlsubscriptionconfigtsubscriptionpayload) passed to [`requestSubscription`](../request-subscription/)
4545
* `requestSubscriptionFn`: `?<TSubscriptionPayload>(IEnvironment, GraphQLSubscriptionConfig<TSubscriptionPayload>) => Disposable`. An optional function with the same signature as [`requestSubscription`](../request-subscription/), which will be called in its stead. Defaults to `requestSubscription`.
4646

4747
<GraphQLSubscriptionConfig />

0 commit comments

Comments
 (0)