[USER_LOGGED_IN_A]: (state, action) => Object.assign({}, state, action.userPayload);
[USER_LOGGED_IN_B]: (state) => state;
[USER_LOGGED_IN_C]: (state, action) => Object.assign({}, state, action.userPayload);
export const startAuthListener = function () {
//this listener will update state upon changes of auth status.
return (dispatch, getState)=> { //using a redux-thunk instead of normal action
firebase.auth().onAuthStateChanged(function (user) {
if (user) {
// User is signed in, dispatch action
console.log(user);
//action A
dispatch({type: USER_LOGGED_IN_A, userPayload: user.providerData})
//action B
dispatch({type: USER_LOGGED_IN_B})
//action C
dispatch({type: USER_LOGGED_IN_C, userPayload: user})
}
});
}
}The console.log statement works fine--the {user} object is returned and appears in order.Actions A and B also fire, and the state updates appropriately.Now here's where it gets weird. Action C never fires--no errors, no stateupdates, no record of the action emitting (as per Redux DevTools).
The only sign of life I can detect is if I put a console.log statement in the reducer function.
That works fine & the object appears normal.
I've been troubleshooting this for some time & can't arrive at a good explanation.
Redux appears to be working fine w/ every object I throw at it, so I'm guessing it's something to do
with the auth data object.
I'm using the latest client SDK, loaded in my index.html file from https://www.gstatic.com/firebasejs/live/3.0/firebase.jsAnyone encounter this before?
--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/c35d12ac-9f5b-4b60-aeda-ffe15d871174%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
So action A, the user.providerData, is itself another object, and fires just fine. So too does any other object I've tried (including across several redux projects), which is one of the reasons I started thinking it might be a Firebase thing (new SDK and all). This setup also worked fine in the previous firebase SDK.
Good idea re: trying one property at a time. If that doesn't find the problem, I'll try and setup a minimal example. Thanks Jacob.
--
You received this message because you are subscribed to a topic in the Google Groups "Firebase Google Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/firebase-talk/Lp6I9uS0PAo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to firebase-tal...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/CAGcMwsBMHVBFfgpmdM5D-Sh%2Bk91Gox0NWJtOQM48aaLJdOHaqA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/CA%2B715k0QxruBHGcmHAoB%3DSfeKrzX7ScyAx-XYy00cSh_TvbJoQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/CAOHy-X5XW5W-v9kswCdMn%3DvFqXL5U%2BrWt-PWymSQO3UJFkWQkg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/AD0A9ED2-D6C9-4DBB-B066-07A6FFB21C90%40gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/CAGcMwsDLtEFsQ1XiYoyTYJ9h1X6AUfrwTZVRhh207o7ON7wP6w%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/31C65A53-3F72-432E-91A8-05C752EBFDE1%40gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/CAOHy-X7m3oAoOZY9%3D%3DdbCbxcxYK_Ow36Z7ySRjy3gsYbxHKzQw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/CAGcMwsC766pcLvQFU_4yikUGLX7%3DjU4F44u8X7DZBeG1PzVa0w%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/CA%2B715k1KhMVbwuY_J1KTt%3D4cSD6Sq-DnE2MiitDrpLnw%2BtuS1A%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/1FA5D973-B1C5-4EE7-8A4C-9EE6A77886AA%40gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/CA%2B715k2Tnvq3EN%2Bj2dyX%2Bgs0PvhPPQv1Zwdo1f5dT%2B5ed2nUuw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/023ecf65-de53-4daa-88e5-53c1974b1dde%40googlegroups.com.