refactor(store)!: remove pinia
* replace pinia with a reactive state object and inject/provide Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com> update(store)!: inject store if possible, otherwise create a new one by id Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import useState from './state'
|
||||
import useActions from './actions'
|
||||
import useGetters from './getters'
|
||||
import { FlowState, FlowStore } from '~/types'
|
||||
|
||||
export default (id: string, preloadedState: FlowState): FlowStore => {
|
||||
const state = reactive(useState(preloadedState))
|
||||
const getters = useGetters(state)
|
||||
const actions = useActions(state, getters)
|
||||
return {
|
||||
state,
|
||||
...toRefs(state),
|
||||
...getters,
|
||||
...actions,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user