{"library":"redux-shapeshifter-middleware","title":"Redux Shapeshifter Middleware","description":"Redux middleware version 1.3.5 that enhances Redux actions to handle AJAX calls using axios and qs. It allows actions to define API endpoints, methods, payload generators, authentication from Redux store state, and advanced features like ETags, request cancellation, and response transformations. Released under an active maintenance cadence, it differentiates from other Redux async middleware by integrating deeply with axios configuration and supporting generator-based action flows.","language":"javascript","status":"active","last_verified":"Sat Apr 25","install":{"commands":["npm install redux-shapeshifter-middleware"],"cli":null},"imports":["import shapeshifter from 'redux-shapeshifter-middleware'","import shapeshifter from 'redux-shapeshifter-middleware'","import shapeshifter from 'redux-shapeshifter-middleware'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import { createStore, applyMiddleware } from 'redux';\nimport shapeshifter from 'redux-shapeshifter-middleware';\n\nconst apiMiddleware = shapeshifter({\n  base: 'https://api.example.com/',\n  auth: {\n    user: 'token'\n  },\n  fallbackToAxiosStatusResponse: true\n});\n\nconst reducer = (state = {}) => state;\nconst store = createStore(reducer, applyMiddleware(apiMiddleware));\n\n// Dispatch an API action\nstore.dispatch({\n  type: 'FETCH_USER',\n  types: ['FETCH_USER_PENDING', 'FETCH_USER_SUCCESS', 'FETCH_USER_ERROR'],\n  method: 'GET',\n  payload: {\n    url: '/users/123',\n    auth: true\n  }\n});","lang":"javascript","description":"Demonstrates setting up the middleware with a base URL and auth config, then dispatching a GET request action with lifecycle types.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}