Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document Using useEffect with observables #138

Open
JRJurman opened this issue Apr 5, 2020 · 1 comment
Open

Document Using useEffect with observables #138

JRJurman opened this issue Apr 5, 2020 · 1 comment

Comments

@JRJurman
Copy link
Member

JRJurman commented Apr 5, 2020

Summary

It may or may not be obvious, but in order to have a useEffect "see" an observable, it needs to be called inside the useEffect function, e.g.

useEffect(() => {
	const { isSignedIn } = useGoogleOAuthSignedInStatus()
	if (!isSignedIn) {
		console.log('User Is Not Signed In... waiting...')
		return
	}
	console.log('User is signed in... creating events and hangout link...')
})

This should be formally documented with an example.

@JRJurman
Copy link
Member Author

JRJurman commented Jul 3, 2022

I wonder if we should have an additional function to call in useEffect that "watches" an observable for changes... Need a better example to showcase this 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant