Created
March 18, 2017 21:50
-
-
Save donjajo/ab6cce131f8dc8ed5623ae32c3af14cf to your computer and use it in GitHub Desktop.
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
export function load_cat_names() { | |
return dispatch => { | |
return fetch( '/?token=' + vitals.token, { | |
method : 'POST', | |
headers : { | |
'X-Requested-With' : 'XMLHttpRequest' | |
}, | |
body : JSON.stringify({ action : 'cat_names' }), | |
credentials : 'same-origin' | |
}) | |
.then( response => response.json() ) | |
.then( json => { | |
console.log( json.data ); | |
dispatch( loaded_cat_names( json ) ) | |
}) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment