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:
Braks
2021-11-16 19:59:44 +01:00
parent 0bde39fa40
commit 93730a7b98
+2 -1
View File
@@ -19,12 +19,13 @@ type NextElements = {
nextEdges: Edge[]
}
const pinia = createPinia()
let id = 0
export default function useFlowStore(preloadedState: FlowState): StoreDefinition<string, FlowState, any, FlowActions> {
setActivePinia(pinia)
return defineStore({
id: `vue-flow-${Math.floor(Math.random() * 100)}`,
id: `vue-flow-${id++}`,
state: () => ({
...preloadedState,
}),