Revamp of settings to contain more granular control of services
This commit is contained in:
@ -35,6 +35,20 @@ const sendRequest = ( dispatch, getState, params ) => {
|
||||
})
|
||||
}
|
||||
|
||||
export function connect(){
|
||||
return (dispatch, getState) => {
|
||||
|
||||
dispatch({ type: 'LASTFM_CONNECTING' })
|
||||
|
||||
sendRequest(dispatch, getState, 'method=artist.getInfo&artist=')
|
||||
.then(
|
||||
response => {
|
||||
dispatch({ type: 'LASTFM_CONNECTED' })
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export function getArtist( uri, artist, mbid = false ){
|
||||
return (dispatch, getState) => {
|
||||
if( mbid ){
|
||||
|
||||
@ -2,6 +2,13 @@
|
||||
export default function reducer(lastfm = {}, action){
|
||||
switch (action.type) {
|
||||
|
||||
case 'LASTFM_CONNECT':
|
||||
case 'LASTFM_CONNECTING':
|
||||
return Object.assign({}, lastfm, { connected: false, connecting: true });
|
||||
|
||||
case 'LASTFM_CONNECTED':
|
||||
return Object.assign({}, lastfm, { connected: true, connecting: false });
|
||||
|
||||
default:
|
||||
return lastfm
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user