Redux Async Queue
npm install --save redux-async-queueimport ReduxAsyncQueue from 'redux-async-queue' // no changes here 😀var ReduxAsyncQueue = require('redux-async-queue').defaultvar ReduxAsyncQueue = window.ReduxAsyncQueue.defaultWhat is it?
const MAKE_BURGER = 'MAKE_BURGER';
function makeBurger(ingredients) {
return {
type: MAKE_BURGER,
payload: ingredients,
};
}
function queueMakeBurger(style) {
return {
queue: MAKE_BURGER,
callback: (next, dispatch, getState) => {
getIncredients(style).then(incredients => {
dispatch(makeBurger(ingredients));
next();
}, 1000);
}
}
}Installation
License
Last updated