Skip to content
This repository was archived by the owner on Jul 7, 2021. It is now read-only.

Commit b41f591

Browse files
committed
refactor the fetchPosts function in the postActions file
1 parent 7e07f09 commit b41f591

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/actions/postActions.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { FETCH_POSTS, NEW_POST } from "./types";
22

3-
export function fetchPosts() {
4-
return function (dispatch) {
3+
export const fetchPosts = () => dispatch => {
54
fetch("https://jsonplaceholder.typicode.com/posts")
65
.then((res) => res.json())
76
.then((posts) =>

0 commit comments

Comments
 (0)