Skip to content

Commit

Permalink
refactor(reactivity): avoid optional chaining in getDepFromReactive (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
yangxiuxiu1115 authored Sep 24, 2024
1 parent 7a00f6f commit c0e9434
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions packages/reactivity/src/dep.ts
Original file line number Diff line number Diff line change
Expand Up @@ -378,13 +378,10 @@ export function trigger(
endBatch()
}

/**
* Test only
*/
export function getDepFromReactive(
object: any,
key: string | number | symbol,
): Dep | undefined {
// eslint-disable-next-line
return targetMap.get(object)?.get(key)
const depMap = targetMap.get(object)
return depMap && depMap.get(key)
}

0 comments on commit c0e9434

Please sign in to comment.