Comparing version 1.0.17 to 1.0.18
{ | ||
"name": "kpdux", | ||
"version": "1.0.17", | ||
"version": "1.0.18", | ||
"author": "Kris Papercut <kearis666@gmail.com>", | ||
@@ -15,5 +15,5 @@ "license": "ISC", | ||
"type": "git", | ||
"url": "git+https://bitbucket.org/kearis/kpdux.git" | ||
"url": "git+https://github.com/kearisp/kpdux.git" | ||
}, | ||
"homepage": "https://bitbucket.org/kearis/kpdux/src/master/README.md", | ||
"homepage": "https://github.com/kearisp/kpdux/blob/master/README.md", | ||
"peerDependencies": { | ||
@@ -20,0 +20,0 @@ "redux": "4.x.x" |
@@ -62,2 +62,8 @@ import * as redux from "redux"; | ||
} | ||
Object.defineProperty(this, "rootGetters", { | ||
"get": () => { | ||
return this.getRootGetters(); | ||
} | ||
}); | ||
} | ||
@@ -64,0 +70,0 @@ |
import StoreModule from "./../makes/StoreModule"; | ||
export default (name, moduleData) => { | ||
export default (name, ...parts) => { | ||
let moduleData = {}; | ||
if(typeof name !== "string") { | ||
moduleData = name; | ||
parts.unshift(name); | ||
name = ""; | ||
} | ||
if(typeof moduleData === "function") { | ||
moduleData = moduleData(); | ||
if(parts.length === 1) { | ||
moduleData = parts[0]; | ||
if(typeof moduleData === "function") { | ||
moduleData = moduleData(); | ||
} | ||
if(moduleData instanceof StoreModule) { | ||
return moduleData; | ||
} | ||
} | ||
else { | ||
for(let i in parts) { | ||
let part = parts[i]; | ||
if(typeof part === "function") { | ||
part = part(); | ||
} | ||
part = part._data || part; | ||
moduleData = { | ||
"init": moduleData.init || part.init || (() => {}), | ||
"name": moduleData.name || part.name, | ||
"state": { | ||
...(moduleData.state || {}), | ||
...(part.state || {}) | ||
}, | ||
"reduces": { | ||
...(moduleData.reduces || {}), | ||
...(part.reduces || {}) | ||
}, | ||
"middlewares": { | ||
...(moduleData.middlewares || {}), | ||
...(part.middlewares || {}) | ||
}, | ||
"getters": { | ||
...(moduleData.getters || {}), | ||
...(part.getters || {}) | ||
}, | ||
"mutations": { | ||
...(moduleData.mutations || {}), | ||
...(part.mutations || {}) | ||
}, | ||
"actions": { | ||
...(moduleData.actions || {}), | ||
...(part.actions || {}) | ||
} | ||
}; | ||
} | ||
} | ||
if(!name) { | ||
@@ -18,7 +69,3 @@ name = moduleData.name || ""; | ||
if(moduleData instanceof StoreModule) { | ||
return moduleData; | ||
} | ||
return new StoreModule(name, moduleData); | ||
}; |
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
13873
375
1