Comparing version 0.0.1-a2227030 to 0.0.1-b988254e
@@ -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-a2227030", | ||
"version": "0.0.1-b988254e", | ||
"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": "a2227030a725c42f1d30ec19c0e97232bd467345" | ||
"scripts": { | ||
"test": "jest src" | ||
}, | ||
"gitHead": "b988254e91c1d5090f9ae8f72977c7e236b5d8c5" | ||
} |
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)