Converts using full document state management
This commit is contained in:
24
src/context/document/actions.ts
Normal file
24
src/context/document/actions.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import type { AnyDocument, Relationship } from "@/lib/types";
|
||||
|
||||
export type DocumentAction<D extends AnyDocument> =
|
||||
| {
|
||||
type: "loading";
|
||||
}
|
||||
| {
|
||||
type: "ready";
|
||||
doc: D;
|
||||
relationships: Relationship[];
|
||||
relatedDocuments: AnyDocument[];
|
||||
}
|
||||
| {
|
||||
type: "update";
|
||||
data: D["data"];
|
||||
}
|
||||
| {
|
||||
type: "setRelationship";
|
||||
relationship: Relationship;
|
||||
}
|
||||
| {
|
||||
type: "setRelatedDocument";
|
||||
doc: AnyDocument;
|
||||
};
|
||||
Reference in New Issue
Block a user