<script>
import commandStore from './commandStore'
import { onMount } from 'svelte'
const commands = {
updateName: {
forward(state, name) {
const previous = state.name
state.name = name
return {state, previous}
},
reverse(state, _args, previous) {
state.name = previous
return state
}
},
updateSettings: {
forward(state, settings) {
const previous = state.settings
state.settings = settings
return {state, previous}
},
reverse(state, _args, previous) {
state.settings = previous
return state
}
}
}
const initialValue = {
name: "Untitled",
settings: {background: "#ff0000"}