Created
September 8, 2020 16:49
-
-
Save perjo927/40aaaa0ca9cd152d77ed06c06457b77f to your computer and use it in GitHub Desktop.
Premature Main file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import css from "./main.css"; | |
import { createStore } from "./redux/store/index"; | |
import { actions } from "./redux/actions/index"; | |
import { rootReducer } from "./redux/reducers/index"; | |
import { render } from "lit-html"; | |
import { App } from "./templates/App"; | |
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 () => { | |
// Initial render | |
render(App({ store, actions }), document.body); | |
// Subsequent renders | |
store.subscribe(() => render(App({ store, actions }), document.body)); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment