Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const mergeObjectValues = object =>
Object.entries(object).reduce((acc, [, value]) => ({ ...acc, ...value }), {});
const patchedGetCorrelationId = () =>
getCorrelationId({
userId: selectUserId({ apolloCache: apolloClient }),
});
const createInternalReducer = (injectedReducers = {}) =>
combineReducers({
requestsInFlight: requestsInFlightReducer,
notifications: notificationsReducer,
...injectedReducers,
});
const sdkMiddleware = createSdkMiddleware({
getCorrelationId: patchedGetCorrelationId,
getProjectKey: selectProjectKeyFromUrl,
getTeamId: selectTeamIdFromLocalStorage,
});
export const applyDefaultMiddlewares = (...middlewares) =>
applyMiddleware(...middlewares, thunk, loggerMiddleware);
// We use a factory as it's more practicable for tests
// The application can import the configured store (the default export)
export const createReduxStore = (
preloadedState = { requestsInFlight: null },
// additional middleware, used for testing
additionalMiddlewares = []
) => {
const store = createStore(