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

Changes void to unknown for callback definitions. #462

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Commits on Dec 13, 2023

  1. Changes void to unknown for callback definitions.

    A callback like `() => void` means that the caller must provide a function that is explicitly void returning.  This means one cannot pass a function as a callback that may have a return value that is ignored.  By changing the required return type to `unknown`, it allows the caller to provide either a void returning function, or a function that returns a value.
    
    This is especially valuable when you have callback functions like `() => condition && doThing()`.  Such a function returns a boolean value, which makes it incompatible with `() => void` callback requirements.  You can work around this by wrapping the body with curly braces (to throw away the result of the expression), but it is better to be permissive in what is accepted instead.
    MicahZoltu committed Dec 13, 2023
    Configuration menu
    Copy the full SHA
    db5c98a View commit details
    Browse the repository at this point in the history

Commits on Dec 14, 2023

  1. Ran pnpm changeset

    MicahZoltu committed Dec 14, 2023
    Configuration menu
    Copy the full SHA
    d52dbb9 View commit details
    Browse the repository at this point in the history

Commits on Dec 19, 2023

  1. Configuration menu
    Copy the full SHA
    378c56c View commit details
    Browse the repository at this point in the history