Skip to content

Commit

Permalink
[#1] - Moved all actionTypes constants into small folder.
Browse files Browse the repository at this point in the history
  • Loading branch information
JimmyLv committed Sep 25, 2016
1 parent 9edde61 commit 7063815
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
6 changes: 6 additions & 0 deletions src/constants/actionTypes.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
export const TOGGLE_SIDEBAR: string = 'TOGGLE_SIDEBAR'
export const TOGGLE_CONTENT: string = 'TOGGLE_CONTENT'

export const FETCH_MUSIC: string = 'FETCH_MUSIC'
export const FETCH_MUSIC_ERROR: string = 'FETCH_MUSIC_ERROR'

export const FETCH_ARTICLE_SUMMARY: string = 'FETCH_ARTICLE_SUMMARY'
export const FETCH_ARTICLE_SUMMARY_ERROR: string = 'FETCH_ARTICLE_SUMMARY_ERROR'

export const FETCH_ARTICLE: string = 'FETCH_ARTICLE'
export const FETCH_ARTICLE_ERROR: string = 'FETCH_ARTICLE_ERROR'
4 changes: 1 addition & 3 deletions src/redux/reducers/article.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@
import jsyaml from 'js-yaml'
import { ArticleType } from '../flow/types.x'
import { API_URL } from '../../constants/'
import { FETCH_ARTICLE_ERROR, FETCH_ARTICLE } from '../../constants/actionTypes'

import { hideLoading, showLoading } from 'react-redux-loading-bar'

const FETCH_ARTICLE: string = 'FETCH_ARTICLE'
const FETCH_ARTICLE_ERROR: string = 'FETCH_ARTICLE_ERROR'

const shouldFetchArticle =
(state, id) => !(state.article.id && state.article.id === id)

Expand Down
3 changes: 1 addition & 2 deletions src/redux/reducers/musicList.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// @flow

const FETCH_MUSIC: string = 'FETCH_MUSIC'
const FETCH_MUSIC_ERROR: string = 'FETCH_MUSIC_ERROR'
import { FETCH_MUSIC, FETCH_MUSIC_ERROR } from '../../constants/actionTypes'

export const fetchMusicList = () =>
dispatch => fetch('http://app.atime.me/music-api-server/?p=netease&t=playlist&i=389445274', { mode: 'no-cors' })
Expand Down

0 comments on commit 7063815

Please sign in to comment.