score:4

Accepted answer
var calculate = new Promise(function(resolve, reject){
// some stuff
})

score:2

 calculate.then((newSubtotal, newTotal) => {
        this.setState({
          subtotal: newSubtotal,
          total: newTotal
        });
    });

Related Query

More Query from same tag