update: add default null value to injections
* "disables" warnings about injection not being found * we assume that the injection can be undefined, so we don't need to be spammed about missing injections Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
@@ -67,7 +67,7 @@ const bind = (emit: EmitFunc, hooks: FlowHooks) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default (store: FlowStore, emit?: EmitFunc) => {
|
export default (store: FlowStore, emit?: EmitFunc) => {
|
||||||
let hooks = inject(Hooks)!
|
let hooks = inject(Hooks, null)!
|
||||||
if (!hooks) {
|
if (!hooks) {
|
||||||
if (import.meta.env.DEV) console.warn('hooks context not found; creating default hooks')
|
if (import.meta.env.DEV) console.warn('hooks context not found; creating default hooks')
|
||||||
hooks = store.hooks
|
hooks = store.hooks
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { onLoadToObject } from '~/utils'
|
|||||||
|
|
||||||
let id = 0
|
let id = 0
|
||||||
export default (options?: Partial<FlowOptions>) => {
|
export default (options?: Partial<FlowOptions>) => {
|
||||||
let store = inject(Store)!
|
let store = inject(Store, null)!
|
||||||
|
|
||||||
if (!store) {
|
if (!store) {
|
||||||
const withStorage = options?.storageKey ?? false
|
const withStorage = options?.storageKey ?? false
|
||||||
|
|||||||
Reference in New Issue
Block a user