Skip to content

Commit

Permalink
refactor: remove use of Object.assign
Browse files Browse the repository at this point in the history
TS already transpiles spread to Object.assign with target:es2016
  • Loading branch information
yyx990803 committed Apr 12, 2022
1 parent d121a9b commit 7efb9db
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
12 changes: 4 additions & 8 deletions packages/reactivity/src/effect.ts
Expand Up @@ -237,14 +237,10 @@ export function trackEffects(
dep.add(activeEffect!)
activeEffect!.deps.push(dep)
if (__DEV__ && activeEffect!.onTrack) {
activeEffect!.onTrack(
Object.assign(
{
effect: activeEffect!
},
debuggerEventExtraInfo
)
)
activeEffect!.onTrack({
effect: activeEffect!,
...debuggerEventExtraInfo!
})
}
}
}
Expand Down
1 change: 0 additions & 1 deletion packages/runtime-core/src/apiCreateApp.ts
Expand Up @@ -179,7 +179,6 @@ export function createAppAPI<HostElement>(
hydrate?: RootHydrateFunction
): CreateAppFunction<HostElement> {
return function createApp(rootComponent, rootProps = null) {

if (!isFunction(rootComponent)) {
rootComponent = { ...rootComponent }
}
Expand Down
4 changes: 2 additions & 2 deletions packages/runtime-core/src/apiWatch.ts
Expand Up @@ -92,7 +92,7 @@ export function watchPostEffect(
effect,
null,
(__DEV__
? Object.assign(options || {}, { flush: 'post' })
? { ...options, flush: 'post' }
: { flush: 'post' }) as WatchOptionsBase
)
}
Expand All @@ -105,7 +105,7 @@ export function watchSyncEffect(
effect,
null,
(__DEV__
? Object.assign(options || {}, { flush: 'sync' })
? { ...options, flush: 'sync' }
: { flush: 'sync' }) as WatchOptionsBase
)
}
Expand Down

0 comments on commit 7efb9db

Please sign in to comment.