Environment
No response
Reproduction
- Create a new project
- Install
vue, pinia, pinia-orm.
- Follow the guide.
- Nothing happens, repository didn't modified.
example.js
import { createPinia, setActivePinia } from "pinia"
import { createORM, Model, useRepo, definePiniaOrmPlugin } from "pinia-orm"
import { createApp } from "vue"
const customPlugin = () => definePiniaOrmPlugin((...args) => {
console.log(args)
return args[0]
})
const app = createApp({})
const pinia = createPinia()
.use(
createORM({
plugins: [
customPlugin(),
]
})
)
app.use(pinia)
setActivePinia(pinia)
class Test extends Model {
static entity = 'test'
static fields() {
return {
id: this.uid(),
firstName: this.string(),
lastName: this.string(),
email: this.string(),
}
}
}
console.log(useRepo(Test))
Output
Repository {
database: Database { models: { test: [Test] } },
model: Test { pivot: undefined },
pinia: undefined,
queryCache: WeakCache { [Symbol(Symbol.toStringTag)]: undefined },
hydratedDataCache: Map(0) {},
use: undefined,
config: {
model: {
namespace: '',
withMeta: false,
hidden: [Array],
visible: [Array]
},
cache: { shared: true, provider: [class WeakCache] }
}
}
Describe the bug
Plugin system might not working.
Additional context
No response
Logs
No response
Environment
No response
Reproduction
vue,pinia,pinia-orm.example.js
Output
Describe the bug
Plugin system might not working.
Additional context
No response
Logs
No response