Inside the main process, I am trying to listen to the changes done in Renderer Process (Preload script).
const Store = require('electron-store');
const store = new Store({ watch: true });
const browserWindow = new BrowserWindow({
width: 800,
height: 600,
show: false,
webPreferences: {
preload: MAIN_WINDOW_PRELOAD_WEBPACK_ENTRY,
nodeIntegration: false,
contextIsolation: false,
enableRemoteModule: true
}
});
browserWindow.once('ready-to-show', () => {
browserWindow.show();
browserWindow.webContents.send('test-event', {
'foo': 'bar'
});
console.log('Setting up onDidAnyChange listener');
store.onDidAnyChange(function(newValue, oldValue) {
console.log('newValue:', newValue);
console.log('oldValue:', oldValue);
});
console.log('Setting up onDidChange listener');
store.onDidChange('a', function(newValue, oldValue) {
console.log('newValue:', newValue);
console.log('oldValue:', oldValue);
});
});
const Store = require('electron-store');
const store = new Store({ watch: true });
store.set({''a': 1});
store.set({''a': 2});
store.set({''a': 5});
Even tried adding & changing the values from the Renderer Window Chrome Dev console. Am I missing something here or Is it not supposed to happen this way?
Issue is Callbacks for onDidChange
and onDidAnyChange
not firing at all.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too