Skip to content

Restarting Redux environment without triggering preventDoubleInitialization? #293

@Nantris

Description

@Nantris

We just upgraded to the 2.0.0-alpha.9 and the new setup looks amazingly simple!

I've not gotten things working quite yet, and maybe won't be able to quite yet, but one thing I noticed is preventDoubleInitialization

https://github.com/klarna/electron-redux/blob/alpha/src/utils/misc.ts#L5

With [email protected] we had built in a custom functionality to restart the redux environment to avoid having to restart our entire project.

The core of our solution was just to use something like below to unregister all channels before we re-create our app's windows from scratch:

    channels.forEach(channel => {
      ipcMain.removeAllListeners(channel);
    });

Is there a way to achieve this with the new architecture? If not, might I suggest that previouslyInitialized (https://github.com/klarna/electron-redux/blob/alpha/src/utils/misc.ts#L5) be made into a global instead so users can manually reset it if needed?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions