Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
utils.js 351 B
export const orderReviewers = r => {
  switch (r.status) {
    case 'pending':
      return -1
    case 'accepted':
      return 0
    case 'declined':
    default:
      return 1
  }
}

export const handleError = (fn, dispatch = null) => err => {
  if (typeof dispatch === 'function') {
    dispatch(fn(err))
  } else {
    fn(err)
  }
  throw err
}