electron-redux
Advanced tools
Comparing version 1.1.3 to 1.2.0
@@ -11,2 +11,8 @@ 'use strict'; | ||
function replayActionMain(store) { | ||
// we have to do this to ease remote-loading of the initial state :( | ||
global.reduxState = store.getState(); | ||
store.subscribe(function () { | ||
global.reduxState = store.getState(); | ||
}); | ||
_electron.ipcMain.on('redux-action', function (event, payload) { | ||
@@ -13,0 +19,0 @@ store.dispatch(payload); |
@@ -6,3 +6,3 @@ 'use strict'; | ||
}); | ||
exports.replayActionRenderer = exports.replayActionMain = exports.createAliasedAction = exports.triggerAlias = exports.forwardToRenderer = exports.forwardToMain = undefined; | ||
exports.getInitialStateRenderer = exports.replayActionRenderer = exports.replayActionMain = exports.createAliasedAction = exports.triggerAlias = exports.forwardToRenderer = exports.forwardToMain = undefined; | ||
@@ -33,2 +33,6 @@ var _forwardToMain = require('./middleware/forwardToMain'); | ||
var _getInitialStateRenderer = require('./helpers/getInitialStateRenderer'); | ||
var _getInitialStateRenderer2 = _interopRequireDefault(_getInitialStateRenderer); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -41,2 +45,3 @@ | ||
exports.replayActionMain = _replayActionMain2.default; | ||
exports.replayActionRenderer = _replayActionRenderer2.default; | ||
exports.replayActionRenderer = _replayActionRenderer2.default; | ||
exports.getInitialStateRenderer = _getInitialStateRenderer2.default; |
@@ -15,4 +15,3 @@ "use strict"; | ||
aliases[key] = value; | ||
return undefined; | ||
} | ||
}; |
{ | ||
"name": "electron-redux", | ||
"version": "1.1.3", | ||
"version": "1.2.0", | ||
"description": "Use redux in the main and browser process in electron", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -35,2 +35,3 @@ [![Stories in Ready](https://badge.waffle.io/hardchor/electron-redux.png?label=ready&title=Ready)](https://waffle.io/hardchor/electron-redux) | ||
todoApp, | ||
initialState, // optional | ||
applyMiddleware( | ||
@@ -41,3 +42,4 @@ triggerAlias, // optional, see below | ||
) | ||
) | ||
); | ||
replayActionMain(store); | ||
@@ -51,8 +53,11 @@ ``` | ||
replayActionRenderer, | ||
getInitialStateRenderer, | ||
} from 'electron-redux'; | ||
const todoApp = combineReducers(reducers) | ||
const todoApp = combineReducers(reducers); | ||
const initialState = getInitialStateRenderer(); | ||
const store = createStore( | ||
todoApp, | ||
initialState, | ||
applyMiddleware( | ||
@@ -63,2 +68,3 @@ forwardToMain, // IMPORTANT! This goes first | ||
); | ||
replayActionRenderer(store); | ||
@@ -65,0 +71,0 @@ ``` |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
331549
76
938
126
1