Skip to content

Commit

Permalink
Merge pull request #53 from canyener/refactor-appjs
Browse files Browse the repository at this point in the history
Refactor appjs
  • Loading branch information
canyener authored Mar 25, 2020
2 parents 6d43415 + d688c7c commit d4bf019
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 22 deletions.
21 changes: 0 additions & 21 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,12 @@ import AppRouter from './routers/AppRouter'

import configureStore from './store/configureStore'

import { addExpense } from './actions/expenses'
import { setTextFilter } from './actions/filters'

import getVisibleExpenses from './selectors/expenses'

import './styles/styles.scss'
import 'react-dates/initialize'
import 'react-dates/lib/css/_datepicker.css'


const store = configureStore()

store.dispatch(addExpense({ description: 'Water Bill', amount: 4500 }))
store.dispatch(addExpense({ description: 'Gas Bill', createdAt: 1000 }))
store.dispatch(addExpense({ description: 'Rent', amount: 109500 }))

// store.dispatch(setTextFilter('water'))

// setTimeout(() => {
// store.dispatch(setTextFilter('bill'))
// }, 3000)

const state = store.getState()
const visibleExpenses = getVisibleExpenses(state.expenses, state.filters)

console.log(visibleExpenses)

const jsx = (
<Provider store={store}>
<AppRouter />
Expand Down
2 changes: 1 addition & 1 deletion src/components/ExpenseListFilters.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const mapDispatchToProps = (dispatch) =>({
sortByDate: () => dispatch(sortByDate()),
sortByAmount: () => dispatch(sortByAmount()),
setStartDate: (startDate) => dispatch(setStartDate(startDate)),
setEneDate: (endDate) => dispatch(setEndDate(endDate))
setEndDate: (endDate) => dispatch(setEndDate(endDate))
})

export default connect(mapStateToProps, mapDispatchToProps)(ExpenseListFilters)

0 comments on commit d4bf019

Please sign in to comment.