zedux
zedux copied to clipboard
Is it possible to use Zedux with Electron and to share the store between renderer windows?
Sharing data between Electron windows?
Hello, In Electron the renderer windows can only communicate with the main window. I tried passing
const mainInternals = getInternals();
window.electron.ipcRenderer.sendMessage('newwin', [
'window',
mainInternals,
]);
but mainInternals is JSON with a circular structure and I receive 'Error An object could not be cloned.'. I want to have a render window that open other render windows through sendMessage -> ipcMain -> new BrowserWindow, and these windows should share the same state. I'm also struggling to find the documentation for getInternals and setInternals on https://omnistac.github.io/zedux/ as the search never returns?
Could you guide me to the best place to get electron renderer windows using the same store?