Moved all reducers and actions to their own folders

This commit is contained in:
Deluan
2020-11-08 13:15:46 -05:00
parent 24b040adf9
commit 3fc81638c7
33 changed files with 204 additions and 206 deletions
+23
View File
@@ -0,0 +1,23 @@
import { ADD_TO_PLAYLIST_CLOSE, ADD_TO_PLAYLIST_OPEN } from '../actions'
export const addToPlaylistDialogReducer = (
previousState = {
open: false,
},
payload
) => {
const { type } = payload
switch (type) {
case ADD_TO_PLAYLIST_OPEN:
return {
...previousState,
open: true,
selectedIds: payload.selectedIds,
onSuccess: payload.onSuccess,
}
case ADD_TO_PLAYLIST_CLOSE:
return { ...previousState, open: false, onSuccess: undefined }
default:
return previousState
}
}