From b43785e151a06c91e4c8b3e6e01b615bdc37e33a Mon Sep 17 00:00:00 2001 From: Sophie Alpert Date: Thu, 25 Jul 2019 19:30:55 -0700 Subject: [PATCH] Update use-subscription README (#16216) It was a little confusing that the question asked when NOT to use this package, then the answer says when to use it. I think this is a little better. --- packages/use-subscription/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/use-subscription/README.md b/packages/use-subscription/README.md index b56023d1c6..549230211c 100644 --- a/packages/use-subscription/README.md +++ b/packages/use-subscription/README.md @@ -2,11 +2,11 @@ React hook that safely manages subscriptions in concurrent mode. +This utility can be used for subscriptions to a single value that are typically only read in one place and may update frequently (e.g. a component that subscribes to a geolocation API to show a dot on a map). + ## When should you NOT use this? -This utility should be used for subscriptions to a single value that are typically only read in one place and may update frequently (e.g. a component that subscribes to a geolocation API to show a dot on a map). - -Other cases have **better long-term solutions**: +Most other cases have **better long-term solutions**: * Redux/Flux stores should use the [context API](https://reactjs.org/docs/context.html) instead. * I/O subscriptions (e.g. notifications) that update infrequently should use a mechanism like [`react-cache`](https://github.com/facebook/react/blob/master/packages/react-cache/README.md) instead. * Complex libraries like Relay/Apollo should manage subscriptions manually with the same techniques which this library uses under the hood (as referenced [here](https://gist.github.com/bvaughn/d569177d70b50b58bff69c3c4a5353f3)) in a way that is most optimized for their library usage.