mirror of
https://github.com/ArthurDanjou/website.git
synced 2026-01-14 12:14:42 +01:00
@@ -1,29 +1,29 @@
|
||||
import { defineStore } from 'pinia'
|
||||
import {defineStore} from 'pinia'
|
||||
|
||||
export const useBookmarksStore = defineStore(
|
||||
'bookmarks',
|
||||
() => {
|
||||
const currentCategory = ref<string>('all')
|
||||
const currentFavorite = ref<boolean>(false)
|
||||
'bookmarks',
|
||||
() => {
|
||||
const currentCategory = ref<string>('all')
|
||||
const currentFavorite = ref<boolean>(false)
|
||||
|
||||
const getCategory = computed(() => currentCategory)
|
||||
function setCategory(newCategory: string) {
|
||||
currentCategory.value = newCategory
|
||||
}
|
||||
const getCategory = computed(() => currentCategory)
|
||||
function setCategory(newCategory: string) {
|
||||
currentCategory.value = newCategory
|
||||
}
|
||||
|
||||
const isFavorite = computed(() => currentFavorite)
|
||||
function toggleFavorite() {
|
||||
currentFavorite.value = !currentFavorite.value
|
||||
}
|
||||
const isFavorite = computed(() => currentFavorite)
|
||||
function toggleFavorite() {
|
||||
currentFavorite.value = !currentFavorite.value
|
||||
}
|
||||
|
||||
return {
|
||||
getCategory,
|
||||
setCategory,
|
||||
isFavorite,
|
||||
toggleFavorite,
|
||||
}
|
||||
},
|
||||
{
|
||||
persist: true,
|
||||
},
|
||||
return {
|
||||
getCategory,
|
||||
setCategory,
|
||||
isFavorite,
|
||||
toggleFavorite,
|
||||
}
|
||||
},
|
||||
{
|
||||
persist: true,
|
||||
},
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user