Advertisement
Guest User

Untitled

a guest
May 26th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. function mapDispatchToProps(dispatch: Dispatch<actions.Any>): IPropsFromDispatch {
  2. return {
  3. refreshRefsFromURL: (newURL: URL) => {
  4. dispatch(actions.refListInvalidate());
  5. dispatch(actions.setServerURL(newURL));
  6. fetch(urljoin(newURL + "/ref/"))
  7. .then((response) => response.json())
  8. .then((refs) => {
  9. dispatch(actions.refListEntriesAvailable(refs));
  10. // tslint:disable-next-line:no-console
  11. console.log("before");
  12. dispatch(actions.setSelectedHeadRefHash(refs[refs.length - 1].hash));
  13. // tslint:disable-next-line:no-console
  14. console.log("after"); // << I never get here
  15. })
  16. .catch((err) => console.error)
  17. }
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement