// import { createStore } from 'vuex'
// import { computed, ComputedRef } from 'vue'

// interface State {
//   [key: string]: any
// }

// interface Payload {
//   key: string
//   value: ComputedRef<any>
// }

// const store = createStore({
//   state: {},
//   mutations: {
//     changeState(state: State, payload: Payload) {
//       console.log('change state', payload)

//       state[payload.key] = payload.value
//       console.log('store-----', store.state)
//     },
//   },
// })
// export default function useState<K extends keyof typeof store.state, T>(
//   key: K,
//   value: T
// ): [ComputedRef<T>, (val: T) => void] {
//   store.commit('changeState', { key, value })
//   const setFn = (value: T) => {
//     store.commit('changeState', { key, value })
//   }
//   return [computed(() => store.state[key]), setFn]
// }

// // const [showLoad, setLoad] = useState('SET_LOADING', true)
