Main store and sibling renderers don't get updated (alpha.7)
See original GitHub issueDescribe the bug
We’re finding that Redux devtools says actions have occurred in our renderer, but the value in the store in the renderer does not reflect that except in the window where the value update was initiated.
The really confusing this is that even though the value in Redux’s devtools indicates that it’s been updated, as far as I can tell the value in the store has not actually been updated.
Our app has three windows that all come up at the same time, I’m not sure if that may be relevant.
With version one I know it was important to place the enhancer before/after other enhancers. Is it possible the issue is anything like that?
Our code looks like this:
configurestore.js
middleware.push(sagaMiddleware);
if (scope === 'renderer') {
if (options.runStorage) enhancers.push(electronStorage());
enhance
}
if (scope === 'main') {
enhancers.push(require('electron-redux').mainStateSyncEnhancer());
}
const store = createStore(
rootReducer,
initialState,
composeEnhancers(...enhancers)
);
storeProvider.register(store);
storeProvider.js
const DEFAULT_STORE_OBJ = { getState: () => ({}) };
class Store {
constructor() {
this.reset();
}
register = store => {
this.store = store;
};
access = () => this.store;
getState = () => this.store.getState();
reset = () => {
this.store = DEFAULT_STORE_OBJ;
};
}
export const storeProvider = new Store();
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (8 by maintainers)
Top Results From Across the Web
Vulkan: Clip Children has wrong blend mode and a rendering ...
Child nodes have ugly color blend and have brightness turn to alpha (full white, fully transparent) rather than keeping their unclipped appearance (seems...
Read more >React sibling component updates state of parent causing re ...
Problem I'm facing is each call to customCallbackFunction is triggering re-render in both SiblingComponent and DifferentSiblingComponent .
Read more >Kodi not working? How to fix Kodi problems (Updated for 2022)
Is Kodi not working for you? In this article we'll be explaining how to fix Kodi problems including crashing, and videos that won't...
Read more >Soft Mask - A replacement of Unity UI Mask with alpha support
Hello @UnbridledGames, First, can I move the mask without having to script 'returning' the position of the child elements?
Read more >News | 7 Days to Die | The Survival Horde Crafting Game
We're debuting two new items that will soon be listed on our Amazon Store – a newly ... Do not attempt to enter...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@Slapbox Middleware creation is synchronous, the async part is only the store hydration -> in default, sync scenario, we will fetch the main store state with blocking ipc call (as in here), and with async scenario we will dispatch message that will than fetch the store with async messaging and than hydrate the store via a built in reducer. But middleware itself is a synchronous code for its creation, and same goes for the store enhancer
Seems to be resolved by #285.