Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const initialState = {
config: {
apiUrl: API_ROUTE_PATH,
baseUrl: host,
enableServiceWorker,
requestLanguage,
supportedLangs,
initialNow: new Date().getTime(),
variants: getVariants(state),
entryPath: url.pathname, // the path that the user entered the app on
media: getMedia(userAgent, userAgentDevice),
},
flags,
};
const createStore = getServerCreateStore(
getRouteResolver(routes, basename),
middleware,
request
);
return Promise.resolve(createStore(reducer, initialState));
});
const initializeStore = resolvedRoutes => {
const createStore = getServerCreateStore(
getFindMatches(resolvedRoutes, appContext.basename),
middleware || [],
request
);
const initialState = { config: appContext };
return Promise.resolve(createStore(reducer, initialState));
};