premise:
1, the state data of state needs to be used inside the method
2, the method needs to be called multiple times or called in a loop
3, this method must not be written in action, it does not modify the state in state, it just uses state data and parameters to do some comparative calculations, and returns new results
what I"m doing now is to define this public function externally, and then pass state as an argument every time
export function (state {
//
}
although this can achieve my intention, but I always feel inappropriate? I would like to ask if there is a better way.