Home > @xoram/plugin-panoramique > ServiceAsStore
ServiceAsStore type
Warning: This API is now obsolete.
use StoreAsService instead or let typescript infer your store type
Convert a Service into the corresponding Pinia `store` interface.
Signature:
typescript
export type ServiceAsStore<service extends Service> = Omit<service, keyof Service>;
1
References: Service
Example
ts
export interface BlogService extends Service {
posts: Post[];
}
defineStore<'blog', ServiceAsStore<BlogService>>('blog', () => {
// blog service implementation
}
1
2
3
4
5
6
7
2
3
4
5
6
7