-
-
Notifications
You must be signed in to change notification settings - Fork 555
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
question(integrations): how to get firebase instance in v3.*.* since getFirebase() is deprecated #607
Comments
(See discussion on Gitter.) |
@yorickreum I have been sticking to passing the instance from |
Sounds good! Exposing a middleware for thunk would be the same approach as getFirebase() was? In my particular case I wanted to sign up and send a verification mail directly afterwards. Because I didn't see an actionCreator for sending a verification mail I started to write an own actionCreator, but saw no possibility to access our getFirebase instance... Passing it from the props could be a workaround. |
The goal for the middleware is for it to be even more simple than the All of that aside, import { compose } from 'redux'
import { withHandlers } from 'recompose'
import { withFirebase } from 'react-redux-firebase'
const enhance = compose(
withFirebase
withHandlers(
signupAndEmail: (props) => creds =>
props.firebase
.createUser(creds, {
email: creds.email,
username: creds.username
})
.then(props.firebase.auth().currentUser.sendEmailVerification)
.then(() => {
console.log("Signup and email verification successful:")
})
.catch(err => {
console.error("error with signup:", err)
})
)
) |
any update on this? I want to still have access to firebase instance but use |
@idanlo The version of Directing #617 here as well since I believe it is a similar question. For now, I personally have been accessing the instance from props and passing it as necessary (even to separate sagas/thunks if necessary instead of having it passed as part of setup). |
This is also a duplicate of #635, so going to close this and make future updates there. Thanks to everyone for reaching out with thoughts! |
Since the change to the React context providers (more precisely: #566) the getFirebase() is not available anymore. But how do we access our firebase instance from Redux store now, for example from inside of an action creator?
The text was updated successfully, but these errors were encountered: