problem description
suppose there are two operations, one is to refresh the list and the other is to delete data. I hope that after successfully deleting the data, I will be able to trigger the refresh of the list.
the environmental background of the problems and what methods you have tried
although you can write the operation of refreshing the list again, it feels a bit repetitive, so I wonder if you can directly trigger the original action
.related codes
export default {
namespace: "dblist",
state: {
list: [],
},
effects: {
//
*refesh({ payload }, { call, put }){
const response = yield call(refeshList, payload);
//...
},
*delete({ payload }, { call, put }){
const response = yield call(deleteData, payload);
const { code, result } = response;
if(code!=0){
alert("")
//...refesh
/*
*
* const response = yield call(refeshList, payload);
*/
}
}
}
}
what result do you expect? What is the error message actually seen?
feels like you can refer to refesh
directly in the delete
action. But I don"t know how to quote it. If you want to know, please mention ~ Thank you