Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

213
Views
¿Cómo usar un valor reductor en otro reductor del mismo segmento en el kit de herramientas redux?

** texto fuerte ** Quiero usar el valor de estado del reductor de compra en el reductor de cambio. ¿Cómo puedo acceder a eso?

 import { createSlice } from "@reduxjs/toolkit"; export const cryptoSlice = createSlice({ name: "crypto", initialState: { coins: [], total: 0, }, reducers: { buy: (state, action) => { state.total += +action.payload.input; state.coins.length > 0 ? state.coins.map((coin) => { if (coin.cryptoCoin.id === action.payload.cryptoCoin.id) { coin.input = +action.payload.input + +coin.input; } else { state.coins.push(action.payload); } }) : state.coins.push(action.payload); }, exchange: (state, action) => { state.coins.push({ cryptoCoin: action.payload.exchangeItem, input: action.payload.input, }); console.log(state.coins); }, }, }); export const { buy, exchange } = cryptoSlice.actions; export default cryptoSlice.reducer;

Entonces, este es mi reductor. Quiero usar el valor del estado de compra en mi reductor de intercambio

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!