Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- export const fetchData = async () => {
- const { dispatch } = store;
- dispatch(itemRequested());
- try {
- const res = await fetch(
- `https://api.poe.watch/get?category=weapon&league=Standard`
- );
- const json = await res.json();
- return dispatch(itemsLoaded(json.splice(0, 12)));
- } catch (error) {
- dispatch(itemsError(error));
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement