This commit is contained in:
Yanick Champoux 2021-05-01 18:45:27 -04:00
parent 86325f8ed8
commit 29255ea347
2 changed files with 12 additions and 12 deletions

View File

@ -4,19 +4,19 @@ import u from "updeep";
import { createSelector } from "reselect"; import { createSelector } from "reselect";
const dux = new Updux({ const dux = new Updux({
initial: { initial: {
space: 0, space: 0,
cost: 0, cost: 0,
mass: 0, mass: 0,
}, },
}); });
const set_cargo = action('set_cargo',payload()); const set_cargo = action("set_cargo", payload());
dux.addMutation(set_cargo, space => () => ({ dux.addMutation(set_cargo, (space) => () => ({
space, space,
cost: 0, cost: 0,
mass: space, mass: space,
})); }));
export default dux.asDux; export default dux.asDux;

View File

@ -71,9 +71,9 @@ dux.addSubscription((store) =>
store => store.general.mass, store => store.general.mass,
store => store.streamlining.type, store => store.streamlining.type,
(ship_mass, streamlining ) => { (ship_mass, streamlining ) => {
const mass = ceil( ship_mass * ( const mass = ceil( ship_mass * (
streamlining === 'none' ? 0 streamlining === 'none' ? 0
: streamlining === 'partial' ? 5 : 10 : streamlining === 'partial' ? 5 : 10
) / 100 ); ) / 100 );
const cost = 2 * mass; const cost = 2 * mass;