MCPcopy
hub / github.com/vuejs/composition-api / setup

Function setup

test/apis/watch.spec.js:32–45  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

30 const onCleanupSpy = vi.fn()
31 const vm = new Vue({
32 setup() {
33 const a = ref(1)
34 watch(
35 a,
36 (n, o, _onCleanup) => {
37 spy(n, o, _onCleanup)
38 _onCleanup(onCleanupSpy)
39 },
40 { immediate: true }
41 )
42 return {
43 a,
44 }
45 },
46 template: `<div>{{a}}</div>`,
47 }).$mount()
48 expect(spy).toBeCalledTimes(1)

Callers

nothing calls this directly

Calls 4

refFunction · 0.90
watchFunction · 0.90
watchEffectFunction · 0.90
reactiveFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…