sveltekit-flash-message icon indicating copy to clipboard operation
sveltekit-flash-message copied to clipboard

Remove on click

Open benquan opened this issue 1 year ago • 1 comments

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

benquan avatar Sep 05 '24 22:09 benquan

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;

ciscoheat avatar Sep 06 '24 07:09 ciscoheat