fix: effect() type

This commit is contained in:
richard 2024-06-02 01:13:00 -07:00 • committed by GitHub
parent 6a2241884a
commit 355f849300
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

4
src/index.d.ts vendored
View file

@ -83,12 +83,12 @@ declare namespace Charm {
* changes. Returns a cleanup function that unsubscribes the callback.
*
* Note that dependencies are only evaluated once when the effect is created,
* conditional dependencies may not work as expected.
* so conditional dependencies may not work as expected.
*
* @param callback The function to run.
* @returns A function that unsubscribes the callback.
*/
function effect(callback: () => void): Cleanup;
function effect(callback: () => Cleanup | void): Cleanup;
/**
* Returns the result of the function without subscribing to changes. If a