Skip to content

Commit

Permalink
refactor: use built-in toRaw function
Browse files Browse the repository at this point in the history
  • Loading branch information
wobsoriano committed Dec 4, 2023
1 parent 5e7f654 commit fcb1289
Show file tree
Hide file tree
Showing 13 changed files with 2,593 additions and 1,262 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 23,4 @@ pnpm-debug.log*
*.sw?

# npm
package-lock.json
*.tgz
2 changes: 1 addition & 1 deletion examples/nuxt3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 13,6 @@
"pinia-shared-state": "workspace:*"
},
"devDependencies": {
"nuxt": "3.5.3"
"nuxt": "3.8.2"
}
}
Original file line number Diff line number Diff line change
@@ -1,6 1,7 @@
import { PiniaSharedState } from 'pinia-shared-state'

export default defineNuxtPlugin((nuxtApp) => {
// @ts-expect-error: Missing types?
nuxtApp.$pinia.use(PiniaSharedState({
enable: true,
}))
Expand Down
5 changes: 3 additions & 2 deletions examples/nuxt3/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 2,8 @@
// https://v3.nuxtjs.org/concepts/typescript
"extends": "./.nuxt/tsconfig.json",
"compilerOptions": {
"types": ["@pinia/nuxt"],
"strict": true
"moduleResolution": "bundler",
"strict": true,
"noEmit": true
}
}
1 change: 1 addition & 0 deletions examples/vite/package.json
Original file line number Diff line number Diff line change
@@ -1,5 1,6 @@
{
"name": "vite",
"type": "module",
"version": "0.0.0",
"scripts": {
"dev": "vite",
Expand Down
6 changes: 6 additions & 0 deletions examples/vite/src/App.vue
Original file line number Diff line number Diff line change
@@ -1,7 1,13 @@
<script setup lang="ts">
import { onMounted } from 'vue'
import { share } from 'pinia-shared-state'
import { useCounterStore } from './store'
const counterStore = useCounterStore()
onMounted(() => {
share('foo', counterStore, { initialize: true })
})
</script>

<template>
Expand Down
2 changes: 1 addition & 1 deletion examples/vite/src/shims-vue.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 1,6 @@
declare module '*.vue' {
import type { DefineComponent } from 'vue'

const component: DefineComponent<{}, {}, any>
const component: DefineComponent<Record<string, unknown>, Record<string, unknown>, any>
export default component
}
6 changes: 3 additions & 3 deletions examples/vite/src/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 18,7 @@ export const useCounterStore = defineStore('counter', {
},
},

share: {
enable: true,
},
// share: {
// enable: true,
// },
})
12 changes: 11 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,9 1,17 @@
{
"name": "pinia-shared-state",
"type": "module",
"publishConfig": {
"access": "public"
},
"version": "0.4.5",
"packageManager": "[email protected]",
"author": {
"name": "Robert Soriano",
"email": "[email protected]"
},
"license": "MIT",
"funding": "https://github.com/sponsors/wobsoriano",
"repository": {
"type": "git",
"url": "https://github.com/wobsoriano/pinia-shared-state.git"
Expand Down Expand Up @@ -41,6 49,7 @@
"scripts": {
"build": "tsup",
"dev": "pnpm build --watch --onSuccess=\"pnpm --filter vite dev\"",
"dev:nuxt": "pnpm build --watch --onSuccess=\"pnpm --filter nuxt3 dev\"",
"release": "bumpp && npm publish",
"prepublishOnly": "npm run build",
"lint": "eslint .",
Expand All @@ -50,7 59,8 @@
"pinia": "^2"
},
"dependencies": {
"broadcast-channel": "^7.0.0"
"broadcast-channel": "^7.0.0",
"vue-demi": "^0.14.6"
},
"devDependencies": {
"@antfu/eslint-config": "^2.2.1",
Expand Down
Loading

0 comments on commit fcb1289

Please sign in to comment.