We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5d44937 commit 5b0c92cCopy full SHA for 5b0c92c
packages/pinia/src/store.ts
@@ -84,6 +84,13 @@ const skipHydrateSymbol = __DEV__
84
: /* istanbul ignore next */ Symbol()
85
const skipHydrateMap = /*#__PURE__*/ new WeakMap<any, any>()
86
87
+/**
88
+ * Tells Pinia to skip the hydration process of a given object. This is useful in setup stores (only) when you return a
89
+ * stateful object in the store but it isn't really state. e.g. returning a router instance in a setup store.
90
+ *
91
+ * @param obj - target object
92
+ * @returns obj
93
+ */
94
export function skipHydrate<T = any>(obj: T): T {
95
return isVue2
96
? // in @vue/composition-api, the refs are sealed so defineProperty doesn't work...
0 commit comments