-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
feat(guide/computed): add previous to computed #3001
Conversation
Signed-off-by: GitHub <[email protected]>
✅ Deploy Preview for vuejs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
src/guide/essentials/computed.md
Outdated
// When count is >=4, the last value that fulfilled our condition will be returned | ||
// instead until count is less or equal to 3 | ||
alwaysSmall(previous) { | ||
if (this.count >= 3) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: should this be <=3
according to the explanation above?
src/guide/essentials/computed.md
Outdated
// When count is >=4, the last value that fulfilled our condition will be returned | ||
// instead until count is less or equal to 3 | ||
const alwaysSmall = computed((previous) => { | ||
if (count.value >= 3) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same note about <=3
Good catch @NataliaTepluhina! Changed the logic a few times while working on this because I wasn't convinced in the examples that I was providing and completely missed this! I also added the closing |
Thank you @ferferga! I've updated also the examples for writable computeds and I think we're good to go now |
This was shipped silently in Vue 3.4. See PR