mirror of
https://github.com/versia-pub/frontend.git
synced 2026-06-14 15:39:15 +02:00
refactor: ♻️ Simplify Note code with a provide/inject pattern
Some checks failed
Some checks failed
This commit is contained in:
parent
b23ed66401
commit
f5918cc7f9
12 changed files with 140 additions and 199 deletions
11
app/components/notes/provider.ts
Normal file
11
app/components/notes/provider.ts
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import type { Status } from "@versia/client/schemas";
|
||||
import type { InjectionKey } from "vue";
|
||||
import type { z } from "zod";
|
||||
|
||||
type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
||||
|
||||
export const key = Symbol() as InjectionKey<{
|
||||
note: PartialBy<z.infer<typeof Status>, "reblog" | "quote">;
|
||||
isRemote: boolean;
|
||||
rebloggerNote?: z.infer<typeof Status>;
|
||||
}>;
|
||||
Loading…
Add table
Add a link
Reference in a new issue