hyperapp-redux-devtools
Advanced tools
Comparing version 1.1.2 to 1.1.3
28
index.js
@@ -18,3 +18,2 @@ var { createStore } = require("redux"); | ||
var store; | ||
var inAction = false; | ||
@@ -26,24 +25,18 @@ return function(state, actions, view, container) { | ||
actions[key] = function() { | ||
inAction = true; | ||
var result = act.apply(this, arguments)(appActions.getState(), actions); | ||
store.dispatch(action(key, result)); | ||
inAction = false; | ||
return result; | ||
var reducer = act.apply(this, arguments); | ||
return function (state) { | ||
var newState = typeof reducer === "function" ? reducer(state, appActions) : reducer; | ||
store.dispatch(action(key, newState)); | ||
return newState; | ||
}; | ||
}; | ||
}); | ||
actions.getState = function() { | ||
return function(state) { | ||
return state; | ||
actions.replaceState = function(actualState) { | ||
return function (state) { | ||
return actualState; | ||
} | ||
}; | ||
actions.replaceState = function() { | ||
return function (state, actions) { | ||
return store.getState(); | ||
} | ||
}; | ||
store = createStore(reducer, state, composeEnhancers()); | ||
store.subscribe(function() { | ||
if (!inAction) { | ||
actions.replaceState(store.getState()); | ||
} | ||
appActions.replaceState(store.getState()); | ||
}); | ||
@@ -54,1 +47,2 @@ appActions = app(state, actions, view, container); | ||
}; | ||
{ | ||
"name": "hyperapp-redux-devtools", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"description": "hyperapp HOA to utilize redux-devtools-extension for time travel debugging capabilities", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
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
7
5469
43