solid func for beforeunload
I have some user data which I want to save before tab is closed.
Using onCleanup() doesn't save the data.
I had to write this, but wondering if solid provides something similar
2 Replies
We do have a community primitive to save a bit of work: https://primitives.solidjs.community/package/event-listener#createeventlistener
Solid Primitives
A library of high-quality primitives that extend SolidJS reactivity
Is this the recommended way?
or should I just put the beforeunload listener directly on window