Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin system might not working #1942

Open
rustem-nasyrov opened this issue Oct 28, 2024 · 0 comments
Open

Plugin system might not working #1942

rustem-nasyrov opened this issue Oct 28, 2024 · 0 comments

Comments

@rustem-nasyrov
Copy link

Environment

No response

Reproduction

  1. Create a new project
  2. Install vue, pinia, pinia-orm.
  3. Follow the guide.
  4. 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))
node example.js
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant