fix: disable inherting attrs on nodes/edges to avoid warnings
* disable context warnings for non-dev environments Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
@@ -66,7 +66,7 @@ export const createHooks = (): FlowHooks & { bind: (emit: EmitFunc) => FlowHooks
|
||||
export default (emit?: EmitFunc) => {
|
||||
let hooks = inject(Hooks)!
|
||||
if (!hooks) {
|
||||
console.warn('hooks context not found; creating default hooks')
|
||||
if (import.meta.env.DEV) console.warn('hooks context not found; creating default hooks')
|
||||
if (!emit) console.error('no emit function found for hook context.')
|
||||
else {
|
||||
hooks = createHooks().bind(emit)
|
||||
|
||||
@@ -5,7 +5,7 @@ import { Store } from '~/context'
|
||||
export default (options?: Partial<FlowOptions>) => {
|
||||
let store = inject(Store)!
|
||||
if (!store) {
|
||||
console.warn('store context not found; creating default store')
|
||||
if (import.meta.env.DEV) console.warn('store context not found; creating default store')
|
||||
store = useFlowStore({
|
||||
...initialState(),
|
||||
...options,
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
export default (): Window & typeof globalThis & { chrome?: any } => {
|
||||
if (typeof window !== 'undefined') return window
|
||||
else return {} as any
|
||||
type UseWindow = Window & typeof globalThis & { chrome?: any }
|
||||
|
||||
export default (): UseWindow => {
|
||||
if (typeof window !== 'undefined') return window as UseWindow
|
||||
else return { chrome: false } as UseWindow
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user