{"size": 515, "ext": "js", "max_stars_repo_path": "src/components/AppContent/use-init-on-auth.js", "max_stars_repo_name": "atorov/sample-app-3", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/components/AppContent/use-init-on-auth.js", "max_issues_repo_name": "atorov/sample-app-3", "max_issues_repo_issues_event_min_datetime": "2020-03-15T13:00:29.000Z", "max_issues_repo_issues_event_max_datetime": "2020-03-15T13:00:30.000Z", "max_forks_repo_path": "src/components/AppContent/use-init-on-auth.js", "max_forks_repo_name": "atorov/sample-app-3", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 2, "max_forks_count": null, "avg_line_length": 27.1052631579, "max_line_length": 60, "alphanum_fraction": 0.7087378641}
import { useContext, useEffect } from 'react'

import checkSignedIn from '../../lib/check-signed-in'

import { AppDispatchContext } from '../App/AppStateProvider'
import { AuthStateContext } from '../App/AuthStateProvider'

export default function () {
    const appDispatch = useContext(AppDispatchContext)

    const authState = useContext(AuthStateContext)

    const isSignedIn = checkSignedIn(authState)

    useEffect(() => {
        appDispatch({ type: 'appState/INIT' })
    }, [appDispatch, isSignedIn])
}
