feat: Create examples directory and add some examples
* Add svg plugins for vite & rollup update: more bundle stuff
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { setActivePinia, createPinia, defineStore, StoreDefinition } from 'pinia';
|
||||
import { setActivePinia, createPinia, defineStore, StoreDefinition, Pinia } from 'pinia';
|
||||
import { inject } from 'vue';
|
||||
import isEqual from 'fast-deep-equal';
|
||||
import { Edge, Node, NodeDiffUpdate, ReactFlowState, RevueFlowActionsTree, XYPosition } from '../types';
|
||||
import { getConnectedEdges, getNodesInside, getRectOfNodes, isEdge, isNode, parseEdge, parseNode } from '../utils/graph';
|
||||
@@ -10,12 +11,12 @@ type NextElements = {
|
||||
nextEdges: Edge[];
|
||||
};
|
||||
|
||||
const pinia = createPinia();
|
||||
setActivePinia(pinia);
|
||||
|
||||
export default function configureStore(
|
||||
preloadedState: ReactFlowState
|
||||
): StoreDefinition<'revue-flow', ReactFlowState, any, RevueFlowActionsTree> {
|
||||
const pinia = inject<Pinia>(Symbol('pinia')) ?? createPinia();
|
||||
setActivePinia(pinia);
|
||||
|
||||
return defineStore({
|
||||
id: 'revue-flow',
|
||||
state: () => preloadedState,
|
||||
|
||||
+1
-1
@@ -58,6 +58,6 @@ export const initialState: ReactFlowState = {
|
||||
|
||||
const store = configureStore(initialState);
|
||||
|
||||
export type ReactFlowDispatch = RevueFlowActionsTree;
|
||||
export type RevueFlowDispatch = RevueFlowActionsTree;
|
||||
|
||||
export default store;
|
||||
|
||||
Reference in New Issue
Block a user