Skip to content

use useSyncExternalStore to sync data in useObservable - #583

Merged
jhuleatt merged 4 commits into
mainfrom
jhuleatt-usesyncexternalstore
Jul 24, 2023
Merged

use useSyncExternalStore to sync data in useObservable#583
jhuleatt merged 4 commits into
mainfrom
jhuleatt-usesyncexternalstore

Conversation

@jhuleatt

@jhuleatt jhuleatt commented Jun 29, 2023

Copy link
Copy Markdown
Collaborator

Description

Migrating the core of ReactFire to useSyncExternalStore, which is the recommended way to sync state between React and something external (in our case RxJS).

The main changes are in src/useObservable.ts and src/SuspenseSubject.ts.

Also adds a test to test/firestore.test.tsx to address #327.

@jhuleatt jhuleatt linked an issue Jun 29, 2023 that may be closed by this pull request
@jhuleatt
jhuleatt force-pushed the jhuleatt-usesyncexternalstore branch from bed1b6a to 1c2cb90 Compare June 29, 2023 20:57
@jhuleatt
jhuleatt requested a review from HYACCCINT July 13, 2023 19:13
Comment thread src/useObservable.ts Outdated
Co-authored-by: Cynthia Wang <44329917+HYACCCINT@users.noreply.github.com>
@jhuleatt
jhuleatt merged commit 85cb2bb into main Jul 24, 2023
@jhuleatt
jhuleatt deleted the jhuleatt-usesyncexternalstore branch July 24, 2023 19:30
@jhuleatt jhuleatt mentioned this pull request Jul 24, 2023
@FirebaseExtended FirebaseExtended locked and limited conversation to collaborators Aug 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

useFirestoreDocData returns status: "success" for wrong document

2 participants