MCPcopy
hub / github.com/vuejs/core / setup

Function setup

packages/server-renderer/__tests__/ssrWatch.spec.ts:139–158  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

137
138 const App = defineComponent({
139 async setup() {
140 let __temp: any, __restore: any
141
142 watch(text, () => {
143 beforeAwaitTriggered = true
144 })
145 ;[__temp, __restore] = withAsyncContext(() => Promise.resolve())
146 __temp = await __temp
147 __restore()
148
149 watch(text, () => {
150 afterAwaitTriggered = true
151 })
152
153 text.value = 'changed'
154 expect(beforeAwaitTriggered).toBe(false)
155 expect(afterAwaitTriggered).toBe(false)
156
157 return () => h('div', null, text.value)
158 },
159 })
160
161 const app = createSSRApp(App)

Callers

nothing calls this directly

Calls 6

withAsyncContextFunction · 0.85
hFunction · 0.85
onScopeDisposeFunction · 0.85
resolveMethod · 0.65
watchFunction · 0.50
refFunction · 0.50

Tested by

no test coverage detected