sveltekit-flash-message
sveltekit-flash-message copied to clipboard
Remove on click
Is there an option to remove the flash message when I click on it? Or is there an easy way to do it?
I have ser a long time for the messages, but would like the option to remove them if I click on it.
Thanks
Ben
It's very simple, just set the flash store to undefined in a click handler:
import { getFlash } from 'sveltekit-flash-message';
import { page } from '$app/stores';
const flash = getFlash(page);
$flash = undefined;