This repository has been archived on 2024-03-13. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
timekeeper/store/incremental.js

24 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
}
}