-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: disable suspense by default, add suspense hooks (#940)
This PR: - inverts the suspense defaults (we now do not suspend by default, you have to add `suspend:true` in options) - adds `useSuspenseFlag` (analogous to `useSuspenseXxx`) in other libraries, which behaves the same as `useFlag` with `{ suspend: true }` - updates README (specifically encourages use use "query-style" hooks over type-specific hooks - adds `@experimental` jsdoc marker to all suspense options and hooks - associated tests Things to consider: - I did not add `useSuspense{Type}FlagValue` and `useSuspense{Type}FlagDetails` hooks; we could do this if we wanted, but IMO these are already not the primary APIs we want to push users toward in react - we want them to use the generic `useFlag` and `useSuspenseFlag` which return the react query interfaces. Fixes: #933 --------- Signed-off-by: Todd Baert <[email protected]>
- Loading branch information
Showing
5 changed files
with
201 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.