letstri / vaxee

Vaxee is a simple and easy-to-use library for Vue 3 to manage the state of your application.
https://vaxee.letstri.dev
MIT License
56 stars 5 forks source link

global store for states #6

Open lorens-osman-dev opened 1 week ago

lorens-osman-dev commented 1 week ago

I always wondered is there any way to write global solution for statesStores ?


_.set(refName, value) // set global refStore

_.refName // get the value

_.refName.update(newValue) 

this will be great DX

letstri commented 1 week ago

Hello! Can you provide me an example of how to use this update? If I understand you correctly, you want something like this:

const store = createStore('store', ({ state })=> {
  const data = state({})
  return { data }
})

store.set('data', {})

Is it correct?