{"size": 314, "ext": "js", "max_stars_repo_path": "frontend/src/lib/useCachedMutation.js", "max_stars_repo_name": "rage/concepts", "max_stars_repo_stars_event_min_datetime": "2020-02-18T23:50:32.000Z", "max_stars_repo_stars_event_max_datetime": "2020-04-24T06:33:42.000Z", "max_issues_repo_path": "frontend/src/lib/useCachedMutation.js", "max_issues_repo_name": "rage/concepts", "max_issues_repo_issues_event_min_datetime": "2019-05-06T08:36:00.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-17T22:52:42.000Z", "max_forks_repo_path": "frontend/src/lib/useCachedMutation.js", "max_forks_repo_name": "rage/concepts", "max_forks_repo_forks_event_min_datetime": "2019-07-31T10:32:37.000Z", "max_forks_repo_forks_event_max_datetime": "2020-08-11T05:43:33.000Z"}
{"max_stars_count": 2, "max_issues_count": 249, "max_forks_count": 3, "avg_line_length": 28.5454545455, "max_line_length": 58, "alphanum_fraction": 0.7292993631}
import { useCallback } from 'react'
import { useMutation } from '@apollo/react-hooks'

const useCachedMutation = (mutation, args, deps = []) => {
  const [fn] = useMutation(mutation, args)
  // eslint-disable-next-line react-hooks/exhaustive-deps
  return useCallback(fn, deps)
}

export default useCachedMutation
