refactor: move composables, stores, plugins under app/ srcDir; fix server path resolution

This commit is contained in:
Jennie Robinson Faber 2025-08-09 13:31:51 +01:00
parent 8892d2e2a5
commit e1daaede27
7 changed files with 5 additions and 3 deletions

View file

@ -1,25 +0,0 @@
import { useCounterStore } from '~/stores/counter'
export type AppSnapshot = {
counter: { count: number }
}
export function useFixtureIO() {
const exportAll = (): AppSnapshot => {
const counter = useCounterStore()
return {
counter: { count: counter.count }
}
}
const importAll = (snapshot: AppSnapshot) => {
const counter = useCounterStore()
if (snapshot?.counter) {
counter.$patch({ count: snapshot.counter.count ?? 0 })
}
}
return { exportAll, importAll }
}