import { clearHash , getParamsFromHash } from "coral-framework/helpers" ; import { storeAccessTokenInLocalStorage } from "coral-framework/lib/auth" ; import { InitLocalState } from "coral-framework/lib/bootstrap/createManaged" ; import { initLocalBaseState } from "coral-framework/lib/relay" ; /**
 * Initializes the local state, before we start the App.
 */ const initLocalState = async ( { context , auth = null , ... rest } ) => { const params = getParamsFromHash ( context . window ) ; if ( params && params . accessToken ) { clearHash ( context . window ) ; auth = await storeAccessTokenInLocalStorage ( context . localStorage , params . accessToken ) ; } await initLocalBaseState ( { context , auth , ... rest , } ) ; } ; export default initLocalState ;