hyperapp-redux-devtools
Advanced tools
Comparing version 1.1.5 to 1.1.6
25
index.js
@@ -16,6 +16,6 @@ var { createStore } = require("redux"); | ||
function copy(target, source) { | ||
var obj = {} | ||
for (var i in target) obj[i] = target[i] | ||
for (var i in source) obj[i] = source[i] | ||
return obj | ||
var obj = {}; | ||
for (var i in target) obj[i] = target[i]; | ||
for (var i in source) obj[i] = source[i]; | ||
return obj; | ||
} | ||
@@ -26,8 +26,15 @@ | ||
target[path[0]] = | ||
1 < path.length ? set(path.slice(1), value, source[path[0]], {}) : value | ||
return copy(source, target) | ||
1 < path.length ? set(path.slice(1), value, source[path[0]], {}) : value; | ||
return copy(source, target); | ||
} | ||
return value | ||
return value; | ||
} | ||
function get(path, source) { | ||
for (var i = 0; i < path.length; i++) { | ||
source = source[path[i]]; | ||
} | ||
return source; | ||
} | ||
module.exports = function devtools(app) { | ||
@@ -47,3 +54,5 @@ var composeEnhancers = composeWithDevTools({ action: reducAction }); | ||
return function (slice) { | ||
var data = typeof reducer === "function" ? reducer(slice, appActions[path]) : reducer; | ||
var data = typeof reducer === "function" | ||
? reducer(slice, get(path, appActions)) | ||
: reducer; | ||
if (data && !data.then) { | ||
@@ -50,0 +59,0 @@ state = set(path, copy(slice, data), state, {}); |
{ | ||
"name": "hyperapp-redux-devtools", | ||
"version": "1.1.5", | ||
"version": "1.1.6", | ||
"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
7135
76