Comparing version 0.0.1-3ec581c3 to 0.0.1-4bffd04f
@@ -19,4 +19,10 @@ "use strict"; | ||
var _queueReducer = require("./queue-reducer"); | ||
var _queueReducer2 = _interopRequireDefault(_queueReducer); | ||
var _util = require("@cardcore/util"); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } | ||
@@ -50,4 +56,6 @@ | ||
var DEFAULT_STATE = { game: {} }; | ||
function rootReducer() { | ||
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : DEFAULT_STATE; | ||
var action = arguments[1]; | ||
@@ -144,2 +152,5 @@ | ||
} | ||
if (gameActions[action.type]) { | ||
state = (0, _queueReducer2.default)(state, action); | ||
} | ||
_util.rando.clearSeed(); | ||
@@ -146,0 +157,0 @@ return state; |
{ | ||
"name": "cardcore", | ||
"version": "0.0.1-3ec581c3", | ||
"version": "0.0.1-4bffd04f", | ||
"description": "Core functions for cards", | ||
@@ -14,5 +14,9 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@streamplace/ssb-keys": "^7.0.16" | ||
"@streamplace/ssb-keys": "^7.0.16", | ||
"ajv": "^6.5.2" | ||
}, | ||
"gitHead": "3ec581c3f6f424e67d96dac06f7bcf5f3eb6f200" | ||
"scripts": { | ||
"test": "jest src" | ||
}, | ||
"gitHead": "4bffd04fa73be20816bbb166afb41334993ed83e" | ||
} |
import * as gameActions from "@cardcore/game"; | ||
import * as clientActions from "@cardcore/client"; | ||
import queueReducer from "./queue-reducer"; | ||
import { rando } from "@cardcore/util"; | ||
@@ -31,3 +32,5 @@ | ||
export default function rootReducer(state = {}, action) { | ||
const DEFAULT_STATE = { game: {} }; | ||
export default function rootReducer(state = DEFAULT_STATE, action) { | ||
let startRandoSeed = state.game && state.game.randoSeed; | ||
@@ -89,4 +92,7 @@ if (state.game && state.game.randoSeed) { | ||
} | ||
if (gameActions[action.type]) { | ||
state = queueReducer(state, action); | ||
} | ||
rando.clearSeed(); | ||
return state; | ||
} |
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
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
65954
24
927
2
+ Addedajv@^6.5.2
+ Addedajv@6.12.6(transitive)
+ Addedfast-deep-equal@3.1.3(transitive)
+ Addedfast-json-stable-stringify@2.1.0(transitive)
+ Addedjson-schema-traverse@0.4.1(transitive)
+ Addedpunycode@2.3.1(transitive)
+ Addeduri-js@4.4.1(transitive)