ReduxCasts
ReduxCasts copied to clipboard
some question about onDeleteClick method
onDeleteClick() { this.props.deletePost(this.props.params.id) .then(() => { this.context.router.push('/'); }); }
export function deletePost(id) {
const request = axios.delete(${ROOT_URL}/posts/${id}${API_KEY}
);
return { type: DELETE_POST, payload: request }; }
The function "deletePost" does not return a promise. so why the "then" method in function "onDeleteClick" can direct call?