Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Organized Folder Structure, and Added Redux-Logger #143

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16,693 changes: 16,693 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"redux",
"react-redux",
"react-router",
"redux-logger",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really like the idea of adding redux-logger 👍

"react-router-dom",
"typescript",
"prettier"
Expand Down Expand Up @@ -64,6 +65,7 @@
"react-scripts": "4.0.0",
"redux": "^4.0.5",
"redux-devtools-extension": "^2.13.8",
"redux-logger": "^3.0.6",
"redux-mock-store": "^1.5.4",
"typescript": "~4.0.3"
},
Expand Down Expand Up @@ -110,6 +112,7 @@
"@semantic-release/changelog": "5.0.1",
"@semantic-release/git": "9.0.0",
"@semantic-release/github": "7.2.0",
"@types/redux-logger": "^3.0.8",
"codecov": "3.8.1",
"commitizen": "4.2.2",
"cypress": "5.4.0",
Expand Down
2 changes: 1 addition & 1 deletion src/components/counter/Counter.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { Fragment } from 'react'
import { useSelector, useDispatch } from 'react-redux'
import { actionTypes, selectors } from '../../features/counter'
import { actionTypes, selectors } from '../../redux/counter'

const Counter: React.FC = () => {
const count = useSelector(selectors.getCountValue)
Expand Down
2 changes: 1 addition & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import ReactDOM from 'react-dom'
import { Provider } from 'react-redux'
import store from './store'
import store from './redux/store'

import './index.css'

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
21 changes: 21 additions & 0 deletions src/redux/store.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { applyMiddleware, combineReducers, compose, createStore } from 'redux'
import { devToolsEnhancer } from 'redux-devtools-extension'
import logger from 'redux-logger'
import { CounterReducer } from './counter'

/* Create root reducer, containing all features of the application */
const rootReducer = combineReducers({
count: CounterReducer,
})


const store = createStore(
rootReducer,
compose(
applyMiddleware(logger),

/* preloadedState, */ devToolsEnhancer({})
)
)

export default store
15 changes: 0 additions & 15 deletions src/store.ts

This file was deleted.

2 changes: 1 addition & 1 deletion template/src/components/counter/Counter.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Provider } from 'react-redux'
import { mount } from 'enzyme'
import configureStore from 'redux-mock-store'

import { actionTypes } from '../../features/counter'
import { actionTypes } from '../../redux/counter'
import Counter from './Counter'

describe('Counter', () => {
Expand Down
2 changes: 1 addition & 1 deletion template/src/components/counter/Counter.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { Fragment } from 'react'
import { useSelector, useDispatch } from 'react-redux'
import { actionTypes, selectors } from '../../features/counter'
import { actionTypes, selectors } from '../../redux/counter'

const Counter: React.FC = () => {
const count = useSelector(selectors.getCountValue)
Expand Down
2 changes: 1 addition & 1 deletion template/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import ReactDOM from 'react-dom'
import { Provider } from 'react-redux'
import store from './store'
import store from './redux/store'

import './index.css'

Expand Down
21 changes: 21 additions & 0 deletions template/src/redux/store.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { applyMiddleware, combineReducers, compose, createStore } from 'redux'
import { devToolsEnhancer } from 'redux-devtools-extension'
import logger from 'redux-logger'
import { CounterReducer } from './counter'

/* Create root reducer, containing all features of the application */
const rootReducer = combineReducers({
count: CounterReducer,
})


const store = createStore(
rootReducer,
compose(
applyMiddleware(logger),

/* preloadedState, */ devToolsEnhancer({})
)
)

export default store
15 changes: 0 additions & 15 deletions template/src/store.ts

This file was deleted.