clean-logout.s
Last updated
Last updated
You should remove all persisted and in-memory user content after a logout. You should logout from every external services silently.
If my project uses react-apollo
the cache is cleared with
If my project uses redux
there is a LOGOUT
or RESET_CUSTOMER_DATA
action that replaces the user reducers' states with the initial states
If my project uses React-Native AsyncStorage
the cache is cleared with , or if you need to target only some keys.
Errors should be caught and handled
Without cleaning the user data, you will have state and data inconsistencies with the new user.
Without the try catch
, the app will crash if the user has no connection, or if another error happens.