-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RFR] createAdminStore - set initialState on logout #3507
Conversation
Since it's a new feature, you should aim to the Also, it would be better to prepare an enhancement issue to explain what are you suggesting, and why do you think it's a good idea. |
well it's not really fully new feature (i just though function would be nice to have in initial state) consider situation like this, user goes to the app, the app initializes with initialState that contains "important" information (ie. theme, rows per page, or some "stuff") but then the user logouts and suddenly the app state is undefined, it should really reset to initialState and not undefined |
I agree with you! That being said, only bug fixes are merged on master. By "new feature" I meant that this is a totally new behavior of React Aadmin, and this change might even break production apps in some way. Moreover, this PR introduces a new feature in the public API: thie Finally, since the initialState change, mind you update the documentation about the |
ok, |
I would add a word on the |
to prevent undefined behaviour and if initialState is function, call it to get the state
Thanks! |
to prevent undefined behaviour
fixes having undefined state instead of new state
ie. if you have some inital data from localStorage, then you dont wanna forget them on logout
and if initialState is function, call it to get the state