-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cleans up action creations. Adds badge count support. Updates list st…
…ore to use flat ids. Starts work on new list types (single, grouped).
- Loading branch information
Tyler Wanlass
committed
Dec 1, 2017
1 parent
b70b424
commit 6101c40
Showing
32 changed files
with
5,808 additions
and
4,070 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { DECREMENT_TODAY_BADGE_COUNT } from '../actionTypes/actionTypes.js'; | ||
|
||
export const decrementTodayBadgeCount = () => { | ||
return { | ||
type: DECREMENT_TODAY_BADGE_COUNT | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { INCREMENT_TODAY_BADGE_COUNT } from '../actionTypes/actionTypes.js'; | ||
|
||
export const incrementTodayBadgeCount = () => { | ||
return { | ||
type: INCREMENT_TODAY_BADGE_COUNT | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
import { RECEIVE_LISTS } from '../actionTypes/actionTypes.js'; | ||
|
||
export const receiveLists = lists => { | ||
export const receiveLists = (lists, sortOrder) => { | ||
return { | ||
type: RECEIVE_LISTS, | ||
lists: lists | ||
lists, | ||
sortOrder | ||
} | ||
} |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,8 @@ | ||
import _ from 'lodash'; | ||
import { SET_TODAY_BADGE_COUNT } from '../actionTypes/actionTypes.js'; | ||
|
||
const set = count => { | ||
export const setTodayBadgeCount = count => { | ||
return { | ||
type: SET_TODAY_BADGE_COUNT, | ||
count | ||
} | ||
} | ||
|
||
export const setTodayBadgeCount = (count=null) => { | ||
return (dispatch, getState) => { | ||
let state = getState() | ||
let todayListId = _.filter(state.lists, { 'type': 'today'})[0].id; | ||
let computedTodayBadgeCount = _.filter(state.items, { 'completed': false, 'list_id': todayListId }).length | ||
|
||
let badgeCount = count ? count : computedTodayBadgeCount; | ||
dispatch(set(badgeCount)) | ||
} | ||
} |
This file contains 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
This file contains 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
Oops, something went wrong.