Terminal state in ES6 destruction object
I wrote a stateless function, in this function I am using a Destructuring object declaration, but one of my variables has a condition. I wrote this with a triple condition. but I cannot declare it in the Destructuring assignment structure.
This is my declaration:
const pageNo = props.filters.pageno
? props.filters.pageno -1
: 0;
const {
data: {
result: {
total : total
} = {}
},
tags: {
result: {
categoryFilter: {
Title : title
} = {}
} = {}
}
} = props;
+3
source to share
2 answers