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

createEventHook won't pass falsy values into on handlers #3560

Closed
7 tasks done
romansp opened this issue Nov 17, 2023 · 0 comments · Fixed by #3561
Closed
7 tasks done

createEventHook won't pass falsy values into on handlers #3560

romansp opened this issue Nov 17, 2023 · 0 comments · Fixed by #3561

Comments

@romansp
Copy link
Contributor

romansp commented Nov 17, 2023

Describe the bug

When passing falsy values into trigger function of createEventHook these won't be correctly passed to on handlers.

Got broken in this PR: #3507

Unfortunately check in trigger function will ignore all falsy parameters. Should probably be more explicit and check against undefined.

return Promise.all(Array.from(fns).map(fn => param ? fn(param) : (fn as Callback<void>)()))

Reproduction

https://play.vueuse.org/#N4IgDghgxg1hDmBTAziAXAbVAOwgW0XRADcBXRAWgBNE8BLEAGhGQHtSAnKQtEU7MDHhMQNZFA50wAFzqtsRAGrkABABFadFQAoAFhAA2AMxV1sKgGIdE2KLoCUp5CogqaxRAdZgz8FaVkDOmkATxcDLwB3ZxD2FWlWFUjJaUQVAFVsOg8OZEMVZTSAGToAIw4ISRQVI1YOAtUAJhUAMhUAZhFOAyJdaWkwZDQAemH+QXgAOihWPGGyShp6YaDS4bMaAA9JvAArVABfRhx8HhAAAQXSZERhmesRNk5uIgBRTdSOXB7mbt7+wYjMYCITTWbDS7ka63e6Ic4ARgADJMAGyTeHrbBbHb7EBHE4EIiQxDQ4bIfTWKiPdhcM7vT7fLocHq8PoDIajcagmZzYmk8mVRBUBHItEYjaIbZ7Q4AXWYRjoBhQ6FAAEEwGBJgsVSBUngwAYIKkiAAeKjZAB8AB1zCoTaUAglzKEwIgALxWkAO-ryT0qc5QIKwD26yTwJAcbSI+yei0ABQgyGcAHJEcmTcNvU7rbb7Rwcyo7Vn5PEQq6Q8XsH6A0GYCHpGGI9ojIYbjGQPHEymWwYbunM475AWi-VhsP7YPnWX3Z7K9XA3Rg56G3Rw4hI9hSBF252kypk5uIv3K+PyioxzaACqN9dCtAqYDAeI3ykqA4HG2FvPnnMAJUQ3DEHQd4Pk+1jcNkQpvh+ubDOaxAWo8EhSNIRB0PqdTSA+KgSIgRqIK8HjYNIAASrCsDAb41Bwsz7nyNx3HUiDJja6FgJh2HWCYBzUbRyYLMmADcNozNgyBYU+K5rhwjAqCWPFujh1j4YRNikeRMDaPYwlVrY8jiSo4GIJBVAqIpXFaTpokGVJEZQeZiBGFG2k2ja8jaNoxCGOQjhuhaD6fs+q52VQWreYgADUEU6YWRkmWFBiqIpXmJYgOkHNpeLvkAA

System Info

System:
    OS: macOS 14.1
    CPU: (10) arm64 Apple M1 Pro
    Memory: 186.45 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.18.2 - /usr/local/bin/node
    Yarn: 4.0.1 - /opt/homebrew/bin/yarn
    npm: 9.8.1 - /usr/local/bin/npm
    bun: 1.0.6 - ~/.bun/bin/bun
  Browsers:
    Chrome: 119.0.6045.159
    Safari: 17.1
  npmPackages:
    @vueuse/components: ^10.6.1 => 10.6.1 
    @vueuse/core: ^10.6.1 => 10.6.1 
    @vueuse/integrations: ^10.6.1 => 10.6.1 
    vue: ^3.3.8 => 3.3.8

Used Package Manager

yarn

Validations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant