Skip to content

Instantly share code, notes, and snippets.

@perjo927
Created September 8, 2020 15:43
Show Gist options
  • Save perjo927/fd02cd0a6c4e7cb8e19eec5e05c75e70 to your computer and use it in GitHub Desktop.
Save perjo927/fd02cd0a6c4e7cb8e19eec5e05c75e70 to your computer and use it in GitHub Desktop.
Maiden Voyage for Todo App
import { createStore } from "./redux/store/index";
import { actions } from "./redux/actions/index";
import { rootReducer } from "./redux/reducers/index";
const store = createStore(rootReducer, {});
store.subscribe(() => console.log(store.getState()));
const { id } = store.dispatch(actions.addTodo({id: 1, done: false, text: "My first todo"}));
store.dispatch(actions.toggleTodo(id));
store.dispatch(actions.undo());
store.dispatch(actions.redo());
store.dispatch(actions.setVisibility("IN_PROGRESS"));
export default () => {
// Empty for now
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment