rahulb246 / custom-redux

Created with CodeSandbox

Home Page:https://codesandbox.io/s/github/rahulb246/custom-redux

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

custom-redux

Usage sample:

// createStore(reducer, preloadedState, enhancer)
const store = createStore(reducer, initialState);
/**
 * {
 *  getState,
 *  subscribe,
 *  dispatch
 * }
 */

// to check the current state of our store
store.getState();

// to watch store changes
store.subscribe(() => {
  console.log("Listener called");
});

// to trigger store changes
store.dispatch({
  type: "ACTION_TYPE",
  payload: {
    id: 1,
    title: "..."
  }
});

About

Created with CodeSandbox

https://codesandbox.io/s/github/rahulb246/custom-redux


Languages

Language:JavaScript 94.2%Language:HTML 5.8%