0
votes

For example, I have:

productPrice: 120, productQuantity: 2, and I want totalProductPrice to be productPrice * productQuantity.

Is it possible to set it up in initialState of a slice with the redux toolkit?

I tried it like this:

get totalProductPrice() {
  return this.productPrice * this.productQuantity;
}