0
It’s common when you work with Redux set an initial state, example:
const initState = {
pagInicial:1,
pagAtual:1,
maxLinks:2,
maxReg:5
}
So far so good. Now and when I need an initial state, starting with some parameters and calculated fields, example:
const initState = {
pagInicial:1,
totReg:pegar total registros
pagAtual:1,
maxLinks:2,
maxReg:5,
totLinks:Math.ceil(totReg/maxReg),
regInit:((maxReg*pagAtual)-maxReg),
regFim:(maxReg*pagAtual))
}
totReg, Totlinks, regInit, regFim, how to inform on Redux the incial state of these fields?