mirror of
https://github.com/BradNut/boredgame
synced 2025-09-08 17:40:22 +00:00
13 lines
537 B
TypeScript
13 lines
537 B
TypeScript
|
|
import { collectionStore } from '$lib/stores/collectionStore';
|
||
|
|
import { toast } from '$lib/components/toast/toast';
|
||
|
|
import { ToastType, type GameType } from '$lib/types';
|
||
|
|
|
||
|
|
export function addToCollection(game: GameType) {
|
||
|
|
collectionStore.add(game)
|
||
|
|
toast.send(`"${game.name}" added to collection!`, { duration: 3000, type: ToastType.INFO });
|
||
|
|
}
|
||
|
|
|
||
|
|
export function removeFromCollection(game: GameType) {
|
||
|
|
collectionStore.remove(game.id)
|
||
|
|
toast.send(`Removed "${game.name}" from collection!`, { duration: 3000, type: ToastType.INFO });
|
||
|
|
}
|