1.0.4 • Published 8 months ago
use-disposable-list v1.0.4
use-disposable-list
A React hook for a disposable list.
const [notifs, addNotif, removeNotif] = useDisposableList({
hideDuration: 300,
timeout: 2000,
});
interface NotificationsDef {
id: string;
show: boolean;
details?: NotificationDef;
}
const [notifs, addNotif, removeNotif] = useDisposableList<NotificationDef>({
hideDuration: 300,
timeout: 2000,
});
notifs
is a list of disposable notifications to display