examples/nutshell/src/index.js
async function toggleColor(store) {
  await store.update(state => {
    if (state.color === "blue") {
      state.color = "green"
    } else {
      state.color = "blue"
    }
  })
}
async function toggleColor(store) {
  await store.update(state => {
    if (state.color === "blue") {
      state.color = "green"
    } else {
      state.color = "blue"
    }
  })
}
async function toggleColor ( store ) { await store . update ( state => { if ( state . color === "blue" ) { state . color = "green" } else { state . color = "blue" } } ) }
define action to toggle color
define action to toggle color