update: count store id gradually up instead of "randomizing" one
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
@@ -19,12 +19,13 @@ type NextElements = {
|
|||||||
nextEdges: Edge[]
|
nextEdges: Edge[]
|
||||||
}
|
}
|
||||||
const pinia = createPinia()
|
const pinia = createPinia()
|
||||||
|
let id = 0
|
||||||
|
|
||||||
export default function useFlowStore(preloadedState: FlowState): StoreDefinition<string, FlowState, any, FlowActions> {
|
export default function useFlowStore(preloadedState: FlowState): StoreDefinition<string, FlowState, any, FlowActions> {
|
||||||
setActivePinia(pinia)
|
setActivePinia(pinia)
|
||||||
|
|
||||||
return defineStore({
|
return defineStore({
|
||||||
id: `vue-flow-${Math.floor(Math.random() * 100)}`,
|
id: `vue-flow-${id++}`,
|
||||||
state: () => ({
|
state: () => ({
|
||||||
...preloadedState,
|
...preloadedState,
|
||||||
}),
|
}),
|
||||||
|
|||||||
Reference in New Issue
Block a user