I have the following interfaces:
interface TxInterface {
field1: string;
field2: string;
field3: number;
}
interface RxInterface {
field1: string;
field2: string;
field3: number;
field4: string;
field5: string;
}
When I receive an object from server, it is typed with RxInterface. In my App, I continue to use this object when I update values for instance.
When I would like to update object in server, I shall send "TxInterface", that contains some fields of "RxInterface".
So, how can I easily to merge my object from RxInterface to TxInterface before send and take only the fields of TxInterface?