ReduxCasts icon indicating copy to clipboard operation
ReduxCasts copied to clipboard

some question about onDeleteClick method

Open whois002 opened this issue 8 years ago • 0 comments

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?

whois002 avatar Oct 26 '16 15:10 whois002