Skip to content

Commit 9e5a51d

Browse files
committed
refactor(runtime-core): replaced with optional chaining operator
1 parent 2c221fc commit 9e5a51d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/runtime-core/src/apiInject.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ export function provide<T>(key: InjectionKey<T> | string | number, value: T) {
1717
// own provides object using parent provides object as prototype.
1818
// this way in `inject` we can simply look up injections from direct
1919
// parent and let the prototype chain do the work.
20-
const parentProvides =
21-
currentInstance.parent && currentInstance.parent.provides
20+
21+
const parentProvides = currentInstance.parent?.provides
2222
if (parentProvides === provides) {
2323
provides = currentInstance.provides = Object.create(parentProvides)
2424
}

0 commit comments

Comments
 (0)