return function ( dispatch ){ promiseGet( '/contribute/count' ) .then( JSON.parse ) .then( ( parsed ) => { dispatch( { type: types.SET_COUNT, to: parsed.count } ) return parsed.count } ) .catch( ( error ) => { dispatch( sendErrorMail( error ) ) } ) }
return function ( dispatch ){ promiseGet( '/contribute/intro' ) .then( JSON.parse ) .then( promiseJSONOK ) .then( ( parsed ) => { dispatch( { type: types.SET_INTRO, to: parsed.intro } ) return parsed.intro } ) .catch( ( error ) => { dispatch( sendErrorMail( error ) ) } ) }
return function ( dispatch ){ promiseGet( '/administrate/examples/' ) .then( JSON.parse ) .then( promiseJSONOK ) .then( ( parsed ) => { const json = parsed.json dispatch( { type: types.SET_EXAMPLES, to: json } ) return json } ) .catch( ( error ) => { dispatch( sendErrorMail( error ) ) } ) }