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 479a648 commit ae240ebCopy full SHA for ae240eb
src/plugin.js
src/plugin.ts
@@ -0,0 +1,13 @@
1
+import { InjectKey } from 'vue/types/options'
2
+import { Context } from '@nuxt/types'
3
+
4
+const { createStore } = require('<%= options.buildDir %>/store')
5
6
+const { getAccessorFromStore } = require('<%= options.libDir %>/utils')
7
8
+type Inject = (name: InjectKey, property: unknown) => void
9
+const storeAccessor = getAccessorFromStore(createStore())
10
11
+export default async ({ store }: Context, inject: Inject) => {
12
+ inject('accessor', storeAccessor(store))
13
+}
0 commit comments