🍝 Meatball
Future based redux side effects
Alternative to rxjs and redux-observable
Install
yarn add meatball
Meatball has a peer dependency on fluture
yarn add fluture
Usage examples
Listen to any redux action, perform side effect, return a new redux action to be fired
// epics.js // Simple exampleconst simpleEpic = type: 'SUBMIT_SEARCH' // listen for this action // fetch async data // redux action to save data // redux action for handling error // Return multiple actions with an arrayconst multipleEpic = type: 'SUBMIT_SEARCH' // listen for this action // fetch async data // multiple actions // Complex exampleconst complexEpic = type: 'SUBMIT_SEARCH' // listen for this action latest: true // Like rxjs switchMap, cancels previous action if not resolved // delay fetching data for 200ms // multiple actions // Debounce exampleconst debounceEpic = type: 'FILTER_SOMETHING' // listen for this action debounce: 1000 // debounce this action call for 1s // fetch async data // redux action to save data ) // redux action for handling error simpleEpic multipleEpic complexEpic debounceEpic // index.js const store =