Can I clear all global state keys?
jedashford opened this issue · 1 comments
jedashford commented
I apologize if this is already answered somewhere.
Is there a way to clear all global state keys? Why: When we log out the user, we clear async storage and set the on the landing page, but need a way to clear all globalstate keys without having to document them all in a logout function.
quisido commented
import { resetGlobal } from 'reactn';
if you are using the default global state. Just call resetGlobal()
whenever.
Provider.reset();
if you are using a Provider.
Let me know if you need further assistance.