@xcpcio/board-app
Version:
XCPCIO Board App
19 lines (16 loc) • 514 B
text/typescript
import type { UserModule } from "~/types";
import { createPinia } from "pinia";
// Setup Pinia
// https://pinia.vuejs.org/
export const install: UserModule = ({ isClient, initialState, app }) => {
const pinia = createPinia();
app.use(pinia);
// Refer to
// https://github.com/antfu/vite-ssg/blob/main/README.md#state-serialization
// for other serialization strategies.
if (isClient) {
pinia.state.value = (initialState.pinia) || {};
} else {
initialState.pinia = pinia.state.value;
}
};