haditha_ui/stores/hadithaStore.ts
2025-04-26 14:37:06 +03:30

19 lines
381 B
TypeScript

export const useHadithaStore = defineStore("hadithaStore", {
persist: {
storage: piniaPluginPersistedstate.localStorage(),
},
state: () => ({
searchPhrase: "" as string,
}),
getters: {
searchPhraseGetter(state) {
return state.searchPhrase;
},
},
actions: {
searchPhraseSetter(newVal = "") {
this.searchPhrase = newVal;
},
},
});