rozek / svelte-viewport-info

informs about viewport size and orientation (not only for Svelte)
MIT License
9 stars 0 forks source link

svelte:window #1

Open basaran opened 9 months ago

basaran commented 9 months ago

Hello,

I ran into some issues using svelte-viewport-info in a sveltekit project.

So, these all seem to be addressed, but then I realized we also have svelte:window that we could use to get the innerWidth. Is there any benefit to using svelte-viewport-info over svelte:window?

None the less, this is a good example of incorporating vanilla JS and events into svelte. Thank you for your contribution.

P.S I can cleanup my modifications and send a PR if you like.

rozek commented 8 months ago

Thank you very much for hints and plaudit!

Both the tslib dependency and changes required in package.json affect all of my older Svelte contributions - I'm currently updating them as time permits.

Concerning svelte:window: I'm not using Svelte in the moment, and thus, I cannot really answer your question - but I personally (and others) are also using this module in non-Svelte environments (and there, it is of real help)

If (modern) Svelte internals fulfill all your needs, you should definitely do without additional packages like mine, of course.

With greetings from Germany,

Andreas Rozek