Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

repro: loop in watch stop #1

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
"build": "vite build"
},
"dependencies": {
"vue": "3.0.0-rc.4"
"vue": "3.0.0-rc.5"
},
"devDependencies": {
"vite": "1.0.0-rc.3",
"@vue/compiler-sfc": "3.0.0-rc.4"
"@vue/compiler-sfc": "3.0.0-rc.5"
}
}
5 changes: 1 addition & 4 deletions src/App.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<template>
<HelloWorld :counter="counter"/>
<button @click="counter++">Click</button>
<HelloWorld />
</template>

<script lang="ts">
Expand All @@ -13,8 +12,6 @@ export default defineComponent({
HelloWorld
},
setup() {
const counter = ref(0);
return { counter };
}
})
</script>
31 changes: 20 additions & 11 deletions src/components/HelloWorld.vue
Original file line number Diff line number Diff line change
@@ -1,20 +1,29 @@
<template>
<h1>{{ counter }}</h1>
<h1>{{ price }}</h1>
<ul>
<li v-for="(change, index) in history" :key="index">{{ change }}</li>
</ul>
</template>

<script lang="ts">
import { defineComponent, toRefs, watchEffect } from 'vue'
import { defineComponent, ref, watchEffect } from 'vue'

export default defineComponent({
name: 'HelloWorld',
props: {
counter: Number
},
setup(props) {
const { counter } = toRefs(props);
watchEffect(() => {
console.log('The new counter value is: ' + counter.value)
})
name: 'User',
setup() {
const price = ref(10);

const history = ref<Array<string>>([]);
const stopRecording = watchEffect(() => {
history.value.push(`Price changed to ${price.value}`);
});

// stop recording after 3 seconds
setTimeout(() => {
stopRecording();
}, 3000);

return { price, history };
}
})
</script>
91 changes: 89 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,17 @@
estree-walker "^2.0.1"
source-map "^0.6.1"

"@vue/compiler-core@3.0.0-rc.5":
version "3.0.0-rc.5"
resolved "https://registry.yarnpkg.com/@vue/compiler-core/-/compiler-core-3.0.0-rc.5.tgz#dd4f1816fcae34a81bc60e584f97993cad284d54"
integrity sha512-dNz5AObEYg0Oglw3emIsBhTAOVfObrfxDaAzR0UTRDDq+Ohfr6KTSaVQAH88Ym+oa08ZlLZBFc6ARe9doAOIxg==
dependencies:
"@babel/parser" "^7.10.4"
"@babel/types" "^7.10.4"
"@vue/shared" "3.0.0-rc.5"
estree-walker "^2.0.1"
source-map "^0.6.1"

"@vue/compiler-dom@3.0.0-rc.4", "@vue/compiler-dom@^3.0.0-rc.1":
version "3.0.0-rc.4"
resolved "https://registry.yarnpkg.com/@vue/compiler-dom/-/compiler-dom-3.0.0-rc.4.tgz#3c6b56f8c99797b46cf7935ffb1e538a1a1174c7"
Expand All @@ -260,7 +271,37 @@
"@vue/compiler-core" "3.0.0-rc.4"
"@vue/shared" "3.0.0-rc.4"

"@vue/compiler-sfc@3.0.0-rc.4", "@vue/compiler-sfc@^3.0.0-rc.1":
"@vue/compiler-dom@3.0.0-rc.5":
version "3.0.0-rc.5"
resolved "https://registry.yarnpkg.com/@vue/compiler-dom/-/compiler-dom-3.0.0-rc.5.tgz#83905e8601123a3654b90fbd80708a16530ce21a"
integrity sha512-z8n+R1GhFnWuKURLYxfVSEfP7nSNM91qteobxwys55fhlZZuReouMnUwgrn+ois/IL6RdFlT9H+n4+N6yLrdJA==
dependencies:
"@vue/compiler-core" "3.0.0-rc.5"
"@vue/shared" "3.0.0-rc.5"

"@vue/compiler-sfc@3.0.0-rc.5":
version "3.0.0-rc.5"
resolved "https://registry.yarnpkg.com/@vue/compiler-sfc/-/compiler-sfc-3.0.0-rc.5.tgz#374e52a6fbf8fb9aee1213026050a0f1c496fecf"
integrity sha512-huoIFEfFCJxHcpoByAUQti7CIwJdHPLJXKuy2HG7J1B+IEKugtBdF50CLH35ZD8dWM0nyOMFFqTbO7i6CCjL3Q==
dependencies:
"@babel/parser" "^7.10.4"
"@babel/types" "^7.10.4"
"@vue/compiler-core" "3.0.0-rc.5"
"@vue/compiler-dom" "3.0.0-rc.5"
"@vue/compiler-ssr" "3.0.0-rc.5"
"@vue/shared" "3.0.0-rc.5"
consolidate "^0.15.1"
estree-walker "^2.0.1"
hash-sum "^2.0.0"
lru-cache "^5.1.1"
magic-string "^0.25.7"
merge-source-map "^1.1.0"
postcss "^7.0.27"
postcss-modules "^3.1.0"
postcss-selector-parser "^6.0.2"
source-map "^0.6.1"

"@vue/compiler-sfc@^3.0.0-rc.1":
version "3.0.0-rc.4"
resolved "https://registry.yarnpkg.com/@vue/compiler-sfc/-/compiler-sfc-3.0.0-rc.4.tgz#cdd8154c3a6a4dc34405fbdb75db4a55db2fae26"
integrity sha512-zY2F+mk5y9TDF2kzLVU9JmI55sNJQEXmI3STuSbyaSKun2Tfhw4A43AY/TXTI2aHuIWBXnZWzjBG/29SMZxvNQ==
Expand Down Expand Up @@ -290,13 +331,28 @@
"@vue/compiler-dom" "3.0.0-rc.4"
"@vue/shared" "3.0.0-rc.4"

"@vue/compiler-ssr@3.0.0-rc.5":
version "3.0.0-rc.5"
resolved "https://registry.yarnpkg.com/@vue/compiler-ssr/-/compiler-ssr-3.0.0-rc.5.tgz#878406c59daff362ecdcb199fb9467a769ca8de5"
integrity sha512-OU5Vl2+bCDMImS9OeCVnl4lfxZ3/sopdwX2SrUWVKQvCxmmmlyWvoVkC6nNGCs/MrOmIMhKmL6etgzLTWyCkUg==
dependencies:
"@vue/compiler-dom" "3.0.0-rc.5"
"@vue/shared" "3.0.0-rc.5"

"@vue/reactivity@3.0.0-rc.4":
version "3.0.0-rc.4"
resolved "https://registry.yarnpkg.com/@vue/reactivity/-/reactivity-3.0.0-rc.4.tgz#0a917d9809967c78c32436fb0113dac6d157b87a"
integrity sha512-Qer7HKYS70imlxPTiIEeSoxXcGLRL96ZoTzDfAOdEd4kjRcztz9tPhiu/70jEuNoHWmQWSWbn09WLusgMB4Eqw==
dependencies:
"@vue/shared" "3.0.0-rc.4"

"@vue/reactivity@3.0.0-rc.5":
version "3.0.0-rc.5"
resolved "https://registry.yarnpkg.com/@vue/reactivity/-/reactivity-3.0.0-rc.5.tgz#45cff8d839d7ad130b1e499239090050fdecff13"
integrity sha512-oe9C+1jtWUdYL/iNc0OPWbwgOk2rOW2uQ+exx3I6Jo6PKOmnAiPkMElalf9vRnO53rnUphVecMp8BlTJvcNgDw==
dependencies:
"@vue/shared" "3.0.0-rc.5"

"@vue/runtime-core@3.0.0-rc.4":
version "3.0.0-rc.4"
resolved "https://registry.yarnpkg.com/@vue/runtime-core/-/runtime-core-3.0.0-rc.4.tgz#87b5a4022aa86eb717d38751b8b4be4cede0f323"
Expand All @@ -305,6 +361,14 @@
"@vue/reactivity" "3.0.0-rc.4"
"@vue/shared" "3.0.0-rc.4"

"@vue/runtime-core@3.0.0-rc.5":
version "3.0.0-rc.5"
resolved "https://registry.yarnpkg.com/@vue/runtime-core/-/runtime-core-3.0.0-rc.5.tgz#dd59af3a5fc089d1cdc05a657320c0dc17e5c362"
integrity sha512-MRIWreFigxdRuI2moFociUL5rVBfgYPrT7rWfQ0XfOyW46b+AiuCJyZvgbsRXwkAERfW1Tb/mY5forYjX2thOg==
dependencies:
"@vue/reactivity" "3.0.0-rc.5"
"@vue/shared" "3.0.0-rc.5"

"@vue/runtime-dom@3.0.0-rc.4":
version "3.0.0-rc.4"
resolved "https://registry.yarnpkg.com/@vue/runtime-dom/-/runtime-dom-3.0.0-rc.4.tgz#66453056c2761f112d9c04ab816477140bcaa664"
Expand All @@ -314,11 +378,25 @@
"@vue/shared" "3.0.0-rc.4"
csstype "^2.6.8"

"@vue/runtime-dom@3.0.0-rc.5":
version "3.0.0-rc.5"
resolved "https://registry.yarnpkg.com/@vue/runtime-dom/-/runtime-dom-3.0.0-rc.5.tgz#2fd75a1f29b23abf0ffe5ccdedabda11721c5b5b"
integrity sha512-0jwpO3MBqMToq7qC816Z8Y6G8aN4ZKbv7MupgRaepzxhiK0sXcjLQmOATP3g/NyX52UCBJS4wAwsxidqGnAabA==
dependencies:
"@vue/runtime-core" "3.0.0-rc.5"
"@vue/shared" "3.0.0-rc.5"
csstype "^2.6.8"

"@vue/shared@3.0.0-rc.4":
version "3.0.0-rc.4"
resolved "https://registry.yarnpkg.com/@vue/shared/-/shared-3.0.0-rc.4.tgz#fac45cd6fec76a1e284b41f1b49c2cb13c914598"
integrity sha512-cN1YTH/LUPsufLrDQR/n/DxdTu7GjsmLWcZ249mQc+fcYeUdjAFDiOHL2xWE/s3g6jwwOMjS7jelpxYUctD7Gw==

"@vue/shared@3.0.0-rc.5":
version "3.0.0-rc.5"
resolved "https://registry.yarnpkg.com/@vue/shared/-/shared-3.0.0-rc.5.tgz#cea2378e3e37363ddc1f5dd158edc9c9b5b3fff0"
integrity sha512-ZhcgGzBpp+pUzisZgQpM4ctIGgLpYjBj7/rZfbhEPxFHF/BuTV2jmhXvAl8aF9xDAejIcw85xCy92gDSwKtPag==

accepts@^1.3.5:
version "1.3.7"
resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.7.tgz#531bc726517a3b2b41f850021c6cc15eaab507cd"
Expand Down Expand Up @@ -1995,7 +2073,16 @@ vite@1.0.0-rc.3:
vue "^3.0.0-rc.1"
ws "^7.2.3"

vue@3.0.0-rc.4, vue@^3.0.0-rc.1:
vue@3.0.0-rc.5:
version "3.0.0-rc.5"
resolved "https://registry.yarnpkg.com/vue/-/vue-3.0.0-rc.5.tgz#973175d45a892b3bd23ef5de7faa4add9c66275f"
integrity sha512-8t8Y4sHMBGD5iLZ7JfBGmKBJlzesPoL+/nW9EV8s+4LwnKC4rGlRp+Lj2rcign4iQaj0GFaL7DrQ8IoOfVX6+w==
dependencies:
"@vue/compiler-dom" "3.0.0-rc.5"
"@vue/runtime-dom" "3.0.0-rc.5"
"@vue/shared" "3.0.0-rc.5"

vue@^3.0.0-rc.1:
version "3.0.0-rc.4"
resolved "https://registry.yarnpkg.com/vue/-/vue-3.0.0-rc.4.tgz#f17b32914c8add7f4792d618eb4f1358ff4222e8"
integrity sha512-nBmuGl/M2LEHn5Db+9Xm0cJoC7yKpx+9RJJObVMLUB4ru7z+ysL4ugKuag+1ehvl6SnljbvYOcuQeGLLvKK07w==
Expand Down