How to use the redux-starter-kit.configureStore function in redux-starter-kit

To help you get started, we’ve selected a few redux-starter-kit examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github SafetyCulture / grpc-web-devtools / src / index.js View on Github external
var port, tabId
// Setup port for communication with the background script
if (chrome) {
  try {
    tabId = chrome.devtools.inspectedWindow.tabId;
    port = chrome.runtime.connect(null, { name: "panel" });
    port.postMessage({ tabId, action: "init" });
    port.onMessage.addListener(_onMessageRecived);
    chrome.tabs.onUpdated.addListener(_onTabUpdated);

  } catch (error) {
    console.warn("not running app in chrome extension panel")
  }
}

const store = configureStore({
  reducer: {
    network: networkReducer,
    toolbar: toolbarReducer,
    clipboard: clipboardReducer,
  }
});

function _onMessageRecived({ action, data }) {
  if (action === "gRPCNetworkCall") {
    store.dispatch(networkLog(data));
  }
}

function _onTabUpdated(tId, { status }) {
  if (tId === tabId && status === "loading") {
    store.dispatch(clearLog());
github difysjs / difys / src / Modules / Store / index.js View on Github external
import { configureStore } from "redux-starter-kit";
// import devToolsEnhancer from "remote-redux-devtools";
import rootReducer from "./reducers";

const store = configureStore({
	reducer: rootReducer,
	devTools: false
});

export default store;
github hidjou / classsed-redux-hooks / src / redux.js View on Github external
addTodo(state, action) {
      // You can "mutate" the state in a reducer, thanks to Immer
      state.push(action.payload)
    },
    toggleTodo(state, action) {
      const todo = state.find(todo => todo.id === action.payload);
      todo.complete = !todo.complete;
    },
    deleteTodo(state, action) {
      return state.filter((todo) => todo.id !== action.payload)
    }
  }
})

// configureStore automatically adds the Redux DevTools and combines reducers
export const store = configureStore({
  reducer : {
    todos : todosReducer
  }
});

export const {addTodo, toggleTodo, deleteTodo} = actions;
github snphq / react-starter-boilerplate / src / store / index.js View on Github external
export default (history, initialState) => {
  const sagaMiddleware = createSagaMiddleware();

  const store = configureStore({
    middleware: [
      ...getDefaultMiddleware(),
      routerMiddleware(history),
      sagaMiddleware,
    ],
    reducer: createRootReducer(history),
    preloadedState: initialState,
  });

  store.runSaga = sagaMiddleware.run;
  store.close = () => store.dispatch(END);

  return store;
};
github reduxjs / react-redux-benchmarks / sources / forms / src / configureStore.js View on Github external
export default function configureAppStore() {
  const store = configureStore({
    reducer: rootReducer
    //middleware: [thunk],
    //devTools: process.env.NODE_ENV !== "production"
  });

  return store;
}
github TronLink / tronlink-extension / packages / popup / src / index.js View on Github external
createStore() {
        logger.info('Creating redux store');

        this.store = configureStore({
            middleware: [
                ...getDefaultMiddleware(),
                reduxLogger
            ],
            reducer
        });

        logger.info('Created store', this.store);
    },
github markerikson / rsk-github-issues-experiment / src / store.ts View on Github external
import { configureStore } from "redux-starter-kit";

import repoDetailsReducer from "./features/RepoSearch/repoDetails";
import issuesDisplayReducer from "./features/IssuesDisplay/issuesDisplay";
import issuesReducer from "./features/IssuesList/issues";
import commentsReducer from "./features/IssueDetails/comments";

export const store = configureStore({
    reducer: {
        repoDetails: repoDetailsReducer,
        issuesDisplay: issuesDisplayReducer,
        issues: issuesReducer,
        comments: commentsReducer,
    },
});

export type RootState = ReturnType;
github iran-react-community / elegant-react-native / app / store / index.js View on Github external
const persistedReducers = persistReducer(persistConfig, rootReducers);

const defaultMiddlewareConfig = {
  serializableCheck: {
    ignoredActions: ['persist/PERSIST'],
  },
};

const middleware = [
  sagaMiddleware,
  ...getDefaultMiddleware(defaultMiddlewareConfig),
  logger,
];

const store = configureStore({
  reducer: persistedReducers,
  middleware,
  devTools: process.env.NODE_ENV !== 'production',
});

sagaMiddleware.run(rootSaga);

const persistor = persistStore(store);

export {store, persistor};
github Maxvien / next-shopify-storefront / store / index.ts View on Github external
export function createStore(initialState = {}): Store {
  return configureStore({
    reducer: rootReducer,
    preloadedState: initialState
  });
}
github reduxjs / react-redux-benchmarks / sources / deeptree-nested / src / configureStore.js View on Github external
export default function configureAppStore() {
  const store = configureStore({
    reducer: {
      counters: countersReducer,
      strings: stringsReducer
    }
  });

  return store;
}

redux-starter-kit

A simple set of tools to make using Redux easier

MIT
Latest version published 5 years ago

Package Health Score

78 / 100
Full package analysis