prescottprue / react-redux-firebase

Redux bindings for Firebase. Includes React Hooks and Higher Order Components.
https://react-redux-firebase.com
MIT License
2.55k stars 559 forks source link

feat(firestore): option to automatically clear firestore data from state on logout #557

Open apietrzak opened 5 years ago

apietrzak commented 5 years ago

Do you want to request a feature or report a bug?
Bug

What is the current behavior? After calling firebase.logout() auth is cleared but firestore.data is still existing.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via codesandbox or similar. After login call: props.firebase.logout();

What is the expected behavior? firestore.data will be empty like: Logout from Firebase and delete all data from the store (state.firebase.data and state.firebase.auth are set to null).

Which versions of dependencies, and which browser and OS are affected by this issue? Did this work in previous versions or setups? Latest

prescottprue commented 5 years ago

This can be accomplished by dispatching the CLEAR_DATA action type from redux-firestore on logout.

It would be nice to have an option to do this automatically, or at least some better documentation around it.

nwaughachukwuma commented 4 years ago

This can be accomplished by dispatching the CLEAR_DATA action type from redux-firestore on logout.

It would be nice to have an option to do this automatically, or at least some better documentation around it.

Hi @prescottprue any code snippet how this could be achieved?

nwaughachukwuma commented 4 years ago

Hi @prescottprue so I found help https://github.com/prescottprue/redux-firestore/issues/114. Thanks for what you do.