Skip to content

Conversation

Rich-Harris
Copy link
Member

small thing i noticed

@Rich-Harris Rich-Harris merged commit 8e6fe80 into main Apr 4, 2025
4 checks passed
@Rich-Harris Rich-Harris deleted the simplify-canvas-example branch April 4, 2025 19:22
@Hugos68
Copy link

Hugos68 commented Apr 4, 2025

Isn't it even simpler and more modular to use on?

$effect(() => on(window, 'resize' () => {
    canvas.width = window.innerWidth;
    canvas.height = window.innerHeight;
}));

@Rich-Harris
Copy link
Member Author

No, because that won't result in the function being called when the component first mounts

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 this pull request may close these issues.

2 participants