Bypassing dva dispatch in asynchronous update model data

 

My business is in the selection list after the update, the total price immediately be updated, because the model is not updated in real time, so I got in this.props value or an old value, the solution is the value returned by a successful dispatch, pass calculation function handleTotalCalcu used instead handleTotalCalcu value with this.props

    const { payload } = dispatch({
      type: 'im/updateState',
      payload: {
        selectedArr: arr,
      },
    })

    // calculate the total price of 
    the this .handleTotalCalcu (payload)

 

Guess you like

Origin www.cnblogs.com/ww01/p/11640715.html