Answer the question
In order to leave comments, you need to log in
Type depending on value?
There is a type:
export type THook = {
name: "onRequest" | "onResponse"
data: string
}
Answer the question
In order to leave comments, you need to log in
https://www.typescriptlang.org/docs/handbook/union...
export type THook = {
name: 'onRequest';
data: number;
} | {
name: 'onResponse';
data: string;
};
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question