Advertisement
Guest User

Untitled

a guest
Nov 11th, 2020
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. export const fetchData = async () => {
  2.   const { dispatch } = store;
  3.   dispatch(itemRequested());
  4.   try {
  5.     const res = await fetch(
  6.       `https://api.poe.watch/get?category=weapon&league=Standard`
  7.     );
  8.     const json = await res.json();
  9.     return dispatch(itemsLoaded(json.splice(0, 12)));
  10.   } catch (error) {
  11.     dispatch(itemsError(error));
  12.   }
  13. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement