How do I merge nested objects? #41
-
Hey there, Inside a store that will have multiple parts interface CreateOrderStoreType {
orderDetails: OrderDetails;
currentPosition: CurrentPostion;
} const orderDetailsInitialData: OrderDetails = {
status: '',
loanReferenceNumber: '',
jurisdiction: JurisdictionEnum.Nsw,
transactionType: [TransactionTypeEnum.Advance],
preferredSettlementDate: '01-01-2022',
preferredSettlementTime: '12:00 PM',
titleReferenceNumber: '',
titleResponse: {
titleReference: '',
isVerified: false,
address: '',
buildingName: '',
lotNumber: '',
unitFlatShopNumber: '',
streetNumber: '',
streetName: '',
streetType: '',
suburb: '',
state: '',
postCode: '',
},
}; Is there a way to target only the nested values? for example createOrderStore.set.orderDetails.titleResponse(); I used this, but if I have multiple levels deeper later this will get annoying fast createOrderStore.set.orderDetails({
...createOrderStore.get.orderDetails(),
titleResponse,
}); thanks |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
There is no API for nested structures, you'll need to create helpers |
Beta Was this translation helpful? Give feedback.
-
@james-Infotrack would |
Beta Was this translation helpful? Give feedback.
There is no API for nested structures, you'll need to create helpers