2017-05-03 48 views
0

我有一个react-redux-firebase应用程序显示公共和私人数据。随着react-redux-firebase重新连接到firebase登录后

我在第一呈现进程连接数据库火力地堡中所示complete simple example

在嵌套部件的按钮触发props.firebase.logout()方法,并连接到火力地堡我的所有数据消失,甚至公众的。

有没有正确的方法来重新连接到数据库和REDX存储以再次查看公共数据?

目前我做了一个可怕的window.location.reload(),我想避免这种情况。

感谢名单了很多,
Gionatan

回答

0

上登出了Redux商店的火力段内保持一定的数据目前不支持,但它是一个伟大的想法。 I opened an issue to track添加一个应该支持您的用例的功能。

现在,如果要调用firebase.logout()可以重定向到有你的公开数据听众另一页。事情是这样的:

this.props.firebase.logout() 
    .then(() => { 
    // redirect to a route that has listeners with your public data 
    this.context.router.push('/someroute'); 
    }) 

披露:

我的作者做出反应,终极版,火力