This repository has been archived on 2024-03-13. You can view files and clone it, but cannot push or open issues or pull requests.
timekeeper/store/incremental.js

25 lines
526 B
JavaScript

import Decimal from "break_infinity.js"
export const state = () => ({
currency: {
energy: new Decimal(0),
// if it hasn't been your
days: new Decimal(0),
weeks: new Decimal(0),
months: new Decimal(0),
// or even your
years: new Decimal(0)
}
})
export const mutations = {
add(state, { key, value }) {
state.currency[key] = Decimal.add(state.currency[key], value)
},
set(state, { key, value }) {
state.currency[key] = value
}
}