Typescript noob question
Hooboy i have a typescript noob question...
I have a function that returns an array of either {ok: true} or {ok: false, error: "message"} items
how would you describe the return type?
1 Reply
maybe i should make error: null if ok is true...
... then
type BatchResponse = {
ok: boolean;
error: string | null;
}[];
works!