microsoft / redux-dynamic-modules

Modularize Redux by dynamically loading reducers and middlewares.
https://redux-dynamic-modules.js.org
MIT License
1.07k stars 116 forks source link

Support for keeping state mounted #154

Closed MmtBkn closed 3 years ago

MmtBkn commented 3 years ago

Hello,

We have a case where we'd like to keep state after It's initialization for caching purposes.

Current Behaviour; DynamicModuleLoader loads the state when mounted, and removes it when unmounted

Ask; DynamicModuleLoader loads the state when mounted, and won't remove the state when unmounted based off a flag, so the existing state could be reused without initialization.

Thank you.

fostyfost commented 3 years ago

@MmtBkn hello. Try 'retained: true' for your module.