Files
speckle-server/packages/dui3/store/documentInfo.ts
T
Kristaps Fabians Geikins 83d8035dc2 chore: upgrade to eslint 9 (#2348)
* root + server

* frontend

* frontend-2

* dui3

* dui3

* tailwind theme

* ui-components

* preview service

* viewer

* viewer-sandbox

* fileimport-service

* webhook service

* objectloader

* shared

* ui-components-nuxt

* WIP full config

* WIP full linter

* eslint projectwide util

* minor fix

* removing redundant ci

* clean up test errors

* fixed prettier formatting

* CI improvements

* TSC lint fix

* 'buildBatch' needs to be async since some batch types (like Text) require it. Removed a disabled liniting rule from ObjLoader

* removed unnecessary void

---------

Co-authored-by: AlexandruPopovici <alexandrupopoviciioan@gmail.com>
2024-06-12 14:38:02 +03:00

24 lines
678 B
TypeScript

import { defineStore } from 'pinia'
import type { DocumentInfo } from 'lib/bindings/definitions/IBasicConnectorBinding'
export const useDocumentInfoStore = defineStore('documentInfoStore', () => {
const app = useNuxtApp()
const documentInfo = ref<DocumentInfo>()
app.$baseBinding.on('documentChanged', () => {
console.log('doc changed')
setTimeout(async () => {
const docInfo = await app.$baseBinding.getDocumentInfo()
documentInfo.value = docInfo
}, 500) // Rhino needs some time.
})
const initDocInfo = async () => {
documentInfo.value = await app.$baseBinding.getDocumentInfo()
}
void initDocInfo()
return { documentInfo }
})