Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
}
}
export default {
// easy firestore config
firestorePath: 'configTests/nestedFillables',
firestoreRefType: 'doc',
moduleName: 'nestedFillables',
statePropName: null,
sync: {
fillables: ['nested.fillables.yes'],
},
// module
state: initialState(),
mutations: defaultMutations(initialState()),
actions: {},
getters: {},
}
insertHook: function (updateStore, doc, store) {
doc.addedBeforeInsert = true
return updateStore(doc)
},
patchHook: function (updateStore, doc, store) {
doc.addedBeforePatch = true
return updateStore(doc)
},
deleteHook: function (updateStore, id, store) {
if (id === 'stopBeforeDelete') return
return updateStore(id)
}
},
// module
state: initialState(),
mutations: defaultMutations(initialState()),
actions: {},
getters: {},
}
return {
name: 'Satoshi',
pokemonBelt: [],
items: []
}
}
export default {
// easy firestore config
firestorePath: 'coll/{name}',
firestoreRefType: 'doc',
moduleName: 'testPathVar',
statePropName: null,
// module
state: initialState(),
mutations: defaultMutations(initialState()),
actions: {},
getters: {},
}
function initialState () {
return {
iniProp: true,
}
}
export default {
// easy firestore config
firestorePath: 'docs/{randomId}', // this should be randomized each test
firestoreRefType: 'doc',
moduleName: 'initialDoc',
statePropName: null,
// module
state: initialState(),
mutations: defaultMutations(initialState()),
actions: {},
getters: {},
}
function initialState () {
return {
iniProp: true,
defaultPropsNotToBeDeleted: true
}
}
export default {
// easy firestore config
firestorePath: 'configTests/serverHooks', // this should be randomized each test
firestoreRefType: 'doc',
moduleName: 'serverHooks',
statePropName: null,
// module
state: initialState(),
mutations: defaultMutations(initialState()),
actions: {},
getters: {},
sync: {
guard: ['created_by', 'created_at', 'updated_by', 'updated_at']
}
}
name: 'Satoshi',
pokemonBelt: [],
items: [],
multipleFastEdits: null,
stepCounter: 0,
};
}
var mainCharacter = {
// easy firestore config
firestorePath: 'playerCharacters/Satoshi',
firestoreRefType: 'doc',
moduleName: 'mainCharacter',
statePropName: null,
// module
state: initialState$1(),
mutations: createEasyAccess.defaultMutations(initialState$1()),
actions: {},
getters: {},
};
function initialState$2() {
return {
playerName: 'Satoshi',
pokemon: {},
stats: {
pokemonCount: 0,
freedCount: 0,
}
};
}
var pokemonBoxVEA = {
// easy firestore config
updateStore(doc)
},
},
serverChange: {
defaultValues: defaultReceit()
},
// module:
namespaced: true,
state: initialState(),
mutations:
{
resetStateData (state) {
const newState = initialState()
Object.assign(state, newState)
},
...defaultMutations(initialState(), easyAccessConf)
},
actions:
{
},
getters:
{
receitByTxnHash: (state, getters) => {
return Object.values(state.receits)
.reduce((carry, receit) => {
if (!receit.txn) return carry
const txnHash = receit.txn.hash
carry[txnHash] = receit
return carry
}, {})
},
}
function initialState () {
return {
input: 0,
}
}
export default {
namespaced: true,
state: initialState(),
mutations:
{
resetStateData (state) {
const newState = initialState()
Object.assign(state, newState)
},
...defaultMutations(initialState(), easyAccessConf)
},
actions:
{
tap ({state, getters, rootState, rootGetters, commit, dispatch}, input) {
// console.log('state.input → ', state.input)
const precisionCorrection = 10 ** rootGetters['settings/currencyConfig'].precision
// console.log('precisionCorrection → ', precisionCorrection)
const oldVal = Math.floor(state.input * precisionCorrection)
if (oldVal.toString().length >= 9) return
// console.log('oldVal → ', oldVal)
const newVal = Number(oldVal.toString() + input.toString()) / precisionCorrection
dispatch('set/input', newVal)
// console.log('state.input → ', state.input)
},
clear ({state, getters, rootState, rootGetters, commit, dispatch}) {
dispatch('set/input', 0)
serverChange: {
defaultValues: {prices: defaultPrices()},
// modifiedHook: function (updateStore, doc, id, store) {
// console.log('doc → ', doc)
// updateStore(doc)
// },
// removedHook: function (updateStore, doc, id, store) {
// console.log('doc → ', doc, ' id ', id)
// updateStore(doc)
// },
},
// module:
state: initialState(),
mutations:
{
...defaultMutations(initialState(), easyAccessConf),
resetStateData (state) {
const newState = initialState()
Object.assign(state, newState)
},
replaceMenulist (state, payload) {
state.items = payload
},
updateState (state, payload) {
Object.keys(payload).forEach(key => {
this._vm.$set(state, key, payload[key])
})
},
clearTestItems (state) {
state.items = {}
},
},
}
}
export default {
namespaced: true,
state: initialState(),
mounted () {
console.log('this → ', this)
},
mutations:
{
resetStateData (state) {
const newState = initialState()
Object.assign(state, newState)
},
...defaultMutations(initialState(), easyAccessConf)
},
actions:
{
'setColors.primary': ({state, commit, dispatch}, newColor) => {
// dispatch('patchToServer', state.colors.primary, {root: true})
// console.log('patched')
return dispatch('set/colors.primary', newColor)
},
doIt (
{state, getters, rootState, rootGetters, commit, dispatch},
{id} = {}
) {
// getters.someOtherGetter // -> 'foo/someOtherGetter'
// rootGetters.someOtherGetter // -> 'someOtherGetter'
dispatch('someOtherAction') // -> 'foo/someOtherAction'