Skip to content

Commit 70b39cc

Browse files
committed
refactor(core): deprecate useVueFlow options arg (#1465)
refactor(core): deprecate vueflow options
1 parent 798faf1 commit 70b39cc

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

packages/core/src/composables/useVueFlow.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ type Scope = (EffectScope & { vueFlowId: string }) | undefined
1818
* If no store instance is found in context, a new store instance is created and registered in storage
1919
*
2020
* @public
21+
* @param options - optional options to initialize the store instance
2122
* @returns a vue flow store instance
2223
*/
2324
export function useVueFlow(options?: FlowOptions): VueFlowStore {
@@ -125,5 +126,9 @@ export function useVueFlow(options?: FlowOptions): VueFlowStore {
125126
scope.vueFlowId = vueFlow.id
126127
}
127128

129+
if (options) {
130+
warn('options are deprecated and will be removed in the next major version. Use props on the `<VueFlow>` component instead.')
131+
}
132+
128133
return vueFlow
129134
}

packages/core/src/types/flow.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ export interface FlowProps {
208208
}
209209

210210
// Todo: Remove in next major version
211+
/** @deprecated use `FlowProps` instead */
211212
export type FlowOptions = FlowProps
212213

213214
export interface FlowEmits {

0 commit comments

Comments
 (0)