Skip to content

Instantly share code, notes, and snippets.

// actions/polls.js
export const FETCH_SUCCESS = `POLLS_FETCH_SUCCESS`;
export const FETCH_FAILURE = `POLLS_FETCH_FAILURE`;
function fetch() {
return (dispatch) => {
// Set API URL and request options, then...
fetch(url, options)
.then((response) => response.json())
// actions/polls.js
export const FETCH_SUCCESS = `POLLS_FETCH_SUCCESS`;
export const FETCH_FAILURE = `POLLS_FETCH_FAILURE`;
function fetch() {
return (dispatch) => {
// Set API URL and request options, then...
fetch(url, options)
.then((response) => response.json())