Skip to content

Commit 7c4e451

Browse files
authored
chore: rename onDispose to onScopeDispose in warnings and tests (#4355)
1 parent 620a69b commit 7c4e451

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/reactivity/__tests__/effectScope.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ describe('reactivity/effect/scope', () => {
173173
expect(doubled).toBe(undefined)
174174
})
175175

176-
it('should fire onDispose hook', () => {
176+
it('should fire onScopeDispose hook', () => {
177177
let dummy = 0
178178

179179
const scope = new EffectScope()
@@ -192,7 +192,7 @@ describe('reactivity/effect/scope', () => {
192192
expect(dummy).toBe(7)
193193
})
194194

195-
it('should warn onDispose() is called when there is no active effect scope', () => {
195+
it('should warn onScopeDispose() is called when there is no active effect scope', () => {
196196
const spy = jest.fn()
197197
const scope = new EffectScope()
198198
scope.run(() => {
@@ -204,7 +204,7 @@ describe('reactivity/effect/scope', () => {
204204
onScopeDispose(spy)
205205

206206
expect(
207-
'[Vue warn] onDispose() is called when there is no active effect scope to be associated with.'
207+
'[Vue warn] onScopeDispose() is called when there is no active effect scope to be associated with.'
208208
).toHaveBeenWarned()
209209

210210
scope.stop()

packages/reactivity/src/effectScope.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export function onScopeDispose(fn: () => void) {
9898
activeEffectScope.cleanups.push(fn)
9999
} else if (__DEV__) {
100100
warn(
101-
`onDispose() is called when there is no active effect scope` +
101+
`onScopeDispose() is called when there is no active effect scope` +
102102
` to be associated with.`
103103
)
104104
}

0 commit comments

Comments
 (0)